The documentation I've found explaining http.client for Python seems a bit sparse. I want to use it over requests because requests has not worked for our project.
So, knowing that I'm using Python's http.client, I'm seeing again and again request
and putrequest
. Both methods are defined here under HTTPConnection
.
HTTPConnection.request
: This will send a request to the server using the HTTP request method method and the selector url.
HTTPConnection.putrequest
: This should be the first call after the connection to the server has been made. It sends a line to the server consisting of the method string, the url string, and the HTTP version (HTTP/1.1). To disable automatic sending of Host: or Accept-Encoding: headers (for example to accept additional content encodings), specify skip_host or skip_accept_encoding with non-False values.
Also, the source code for both is defined in this file.
From my guess and reading things, it seems like request
is a more high level API compared to putrequest
. Is that correct?