0

I am not using django rest frame work

but in normal views.py I have a simple views

#views.py

def api_post_operations(request):
    pdb.set_trace()
    if request.POST:
        print(request.POST["name"])
        print(request.POST["address"])
       

now I call it

import requests
url = "http://localhost:8000/api_post_operations"
payload = {"name":"raj", "address": "asasass" }
rees = requests.post(url, data=payload, headers={})

it is comming

(Pdb) request.POST
<QueryDict: {}>

Any reason why it is comming {} balnk

request.body also comming blank
Rajarshi Das
  • 11,778
  • 6
  • 46
  • 74

0 Answers0