Curl is a unix command which transferes data. It can send GET, POST, PUT, and DETELE requests to a URL.
Solution for How to use curl in Python : You can use requests to use curl
- Call requests.get(url) to send a GET request to the url.
- Call requests.post(url, data=dict), with url as a URL and dict as a dictionary of keys and values to to send a POST request to the url.
- Call requests.put(url, data=dict), with url as a URL and dict as a dictionary of keys and values to to send a PUT request to the url.
- Call requests.delete(url, data=dict), with url as a URL and dict as a dictionary of keys and values to to send a DELETE request to the url.
After sending a request, call requests.Response.status_code to get the status code of the get request or call requests.Response.text to get the text of the request.
url = "http://httpbin.org/post"