You can use the requests
library in Python to make HTTP requests. Here's an example to make an HTTP POST request with a custom text body:
main.py153 chars9 lines
In the example code above, we first import the requests
library. Then we define the URL we want to make the request to and the custom text body we want to send. We then make an HTTP POST request using the requests.post()
method, passing in the URL and the text body as the data
parameter. Finally, we print the response body returned by the server.
gistlibby LogSnag