0

I can't get POSTMAN to send any post variables to my Django app. Suppose I have a post variable called 'report_request' and it has a value that is a JSON string. On the Django side I want to get request.POST['report_request'] and parse the JSON into a dictionary. But POSTMAN never seems to send the POST data. How exactly do I do this? Is there some magical header I need to send?

Marc
  • 3,386
  • 8
  • 44
  • 68

3 Answers3

3

Doh! My bad. The URL I need to connect to is really HTTPS rather than HTTP, but I was specifying the URL as http://. Apparently if Postman is asked to connect to an HTTPS site using HTTP, it silently just drops all POST variables. How lovely. Anyway it was an easy fix, just change the http:// url to https:// and all is well.

Subodh Joshi
  • 12,717
  • 29
  • 108
  • 202
Marc
  • 3,386
  • 8
  • 44
  • 68
1

Be sure to provide the POST data in the body (body tab) of the request and not in the parameters (params tab). Otherwise, POSTMAN will interpret your POST request as being without data and on a url with GET parameters.

See these specifications about csrf if needed

0

Check if you're sending the csrf token, it's a security feature. https://docs.djangoproject.com/en/1.8/ref/csrf/

user1797792
  • 1,169
  • 10
  • 26