Marc
Marc

Reputation: 3596

How to send POST variable in POSTMAN

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?

Upvotes: 0

Views: 33984

Answers (3)

Marc
Marc

Reputation: 3596

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.

Upvotes: 3

Wilfried FUTCHEA
Wilfried FUTCHEA

Reputation: 211

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

Upvotes: 2

user1797792
user1797792

Reputation: 1189

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

Upvotes: 0

Related Questions