How to send POST request?
If you really want to handle with HTTP using Python, I highly recommend Requests: HTTP for Humans. The POST quickstart adapted to your question is:
If you really want to handle with HTTP using Python, I highly recommend Requests: HTTP for Humans. The POST quickstart adapted to your question is:
urllib is a standard library, you do not have to install it. Simply import urllib
Use urllib.request.urlopen(): This is the most basic way to use the library, minus any error handling. You can also do more complex stuff such as changing headers. On Python 2, the method is in urllib2:
If you want to send requests using urllib3, you need to create a pool manager first. Alternatively, you could use the HTTP client in the Python standard library. Its urlopen function is called urllib.request.urlopen. Depending on what you are trying to do, the requests package might also be an option, but it has certain disadvantages when it comes to certificate management for HTTPS URLs … Read more
You need to pass your parameters into urlencode() as either a mapping (dict), or a sequence of 2-tuples, like: Python 3 or above Use: Note that this does not do url encoding in the commonly used sense (look at the output). For that use urllib.parse.quote_plus.
Use urllib.request.urlopen(): This is the most basic way to use the library, minus any error handling. You can also do more complex stuff such as changing headers. On Python 2, the method is in urllib2:
This works in Python 2.x. For Python 3 look in the docs: