I usually use the get and multi-process implementation of the requests module, but it still feels not fast enough. So I came up with the idea described in the title.
Depending on a variety of reasons, it won't necessarily be faster if you discard the GET response body.
If HEAD meets your requirements, use HEAD.
Remember to use requests.Session, so that access to the same server can be more than doubled.
PS: It is recommended to learn HTTP carefully, so that when you encounter problems, you don’t need to ask and wait, and finally get a solution that you don’t understand.
heads=requests.head(url)
Depending on a variety of reasons, it won't necessarily be faster if you discard the GET response body.
If HEAD meets your requirements, use HEAD.
Remember to use
requests.Session
, so that access to the same server can be more than doubled.PS: It is recommended to learn HTTP carefully, so that when you encounter problems, you don’t need to ask and wait, and finally get a solution that you don’t understand.