can anyone please tell me why i am not able to get the range of contents using content-range header,instead i am getting the whole content in given url.
import requests
url="https://tools.ietf.org/rfc/rfc2822.txt "
content = requests.get(url)
content_len = int(content.headers['Content-Length'])
print(content_len)
headers = {f"Content-Range": f"bytes=0-100/{content_len}"}
r = requests.get(url, headers=headers)
print(r.content)
Usually you would use
Rangeand notContent-Rangefor requesting a subset of a resource. The server will then respond with aHTTP 206 (Partial Content) statusand serve you with the requested range. The response will then contain aContent-Rangeas a header.The following works for example: