I want to use Python to capture info from some websites. I want the HTTP client to meet this conditions:
Supports HTTPS
Will not use too much memory, should not generate a lot of processes or threads.
Has clear documentation and is actively supported
I know that requests
, tornado
, or the gevent
-httpclient
can finish my task, but I do not know which is the best? Or is there some other choices?
Or if there is some other choices written in C
/c++
.
In this article, you will learn about the Python Requests library, which allows you to send HTTP requests in Python.
Python HTTP module defines the classes which provide the client-side of the HTTP and HTTPS protocols. In most of the programs, the HTTP module is not directly used and is clubbed with the urllib module to handle URL connections and interaction with HTTP requests.
The HTTP Client library provides a basic API through which HTTP requests can be created and executed from within your model.
An HTTP Client. An HttpClient can be used to send requests and retrieve their responses. An HttpClient is created through a builder . The builder can be used to configure per-client state, like: the preferred protocol version ( HTTP/1.1 or HTTP/2 ), whether to follow redirects, a proxy, an authenticator, etc.
Use requests
. It has the most same API of the various libraries.
Another option is httplib2
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With