Super friendly <br/>code & developer communities

Super friendly
code & developer communities

A place for coders and developers to share, learn and grow together.

Using Requests to POST data to URL in Python

In python, you can use requests library to make HTTP requests. You can call any API endpoint or get website html to scrape the contents you need.

Use pip to install the requests libarary: pip install requests

Here I will share how to use requests to POST data to any url using python.

import requests
url = ""
headers = {
    # add your headers like auth token here if required
data = {"hello": "world", "data": "this is a string"}
result =, data, headers).text
print result

With the above code snippet you can POST form data to any URL in python.

For more features check the requests documentation:

P.S. If you have any questions, click here to join our community and feel free to ask any questions.