Size of raw response in bytes

后端 未结 2 1418
小鲜肉
小鲜肉 2021-02-01 03:14

I need to make a HTTP request and determine the response size in bytes. I have always used request for simple HTTP requests, but I am wondering if I can achieve th

2条回答
  •  再見小時候
    2021-02-01 04:18

    r.raw is an instance of urllib3.response.HTTPResponse. We can count the length of response by looking up the response's header Content-length or use built-in function len().

提交回复
热议问题