I'm new to Django. I'm trying to get my current request method to see if it is "POST" method.
But I got error message says: Unresolved reference 'request'
I tried to import request, but I don't know which one is correct.
Thanks for your help!
Kind regards,
Xi
CodePudding user response:
Have a look at the following:
import requests
response = requests.post(url, data=body, headers=headers)
CodePudding user response:
My bad, I shouldn't put the request as a variable in a class, request is supposed to work in the function