6π
You donβt return a request but a response. The response do not care if its for GET
or POST
, it depends upon your implementation as to what you want to do and respond for those requests.
EDIT for comment:
You can safely use your method of checking type of request, i.e. using request.method == 'POST'
or request.method == 'GET
. If you want to double sure check for request.POST
as well.
e.g.
if request.method == 'POST' and request.POST:
#do POST processing
elif request.method == "GET" and request.GET :
#do GET processing
π€Rohan
1π
Turns out that one HTTP response (as in the underlying technology) cannot / should not return both POST and GET data. I think this fundamental misunderstanding on my part confused people.
π€jhoyla
Source:stackexchange.com