When I use requests
lib in Python, there are some cases in which I cannot get 'Content-Length'
in headers with 'Transfer-Encoding': 'chunked'
.
Firstly I tried requests.get(image_url)
, there is no 'Content-Length'
in headers.
Then I tried requests.head(image_url)
, there is 'Content-Length'
in headers.
Is there any requests
's method to combine both of get
and head
method? I mean if get
method does not work, then try head
method.