How to send a POST request using django?

zjm1126 picture zjm1126 · Mar 15, 2011 · Viewed 61.2k times · Source

I dont want to use html file, but only with django I have to make POST request.

Just like urllib2 sends a get request.

Answer

Rick Mohr picture Rick Mohr · Aug 12, 2014

Here's how you'd write the accepted answer's example using python-requests:

post_data = {'name': 'Gladys'}
response = requests.post('http://example.com', data=post_data)
content = response.content

Much more intuitive. See the Quickstart for more simple examples.