How to match an empty response body? #1629
Labels
Status: Completed
Nothing further to be done with this issue. Awaiting to be closed.
Type: Bug
Inconsistencies or issues which will cause an issue or problem for users or implementors.
Discussed in #1628
Originally posted by Yardanico March 13, 2024
Hi, I've been using httpx for quite a long time, and it's a really great project! Right now I'm struggling a bit to match empty response bodies. It looks to me that there's no DSL variable that I can use to get the actual length of the response body?
As far as I understand,
content_length
just takesContent-Length
from response headers, and it's not defined if there's no such header present (I know that websites shouldn't respond like this, but sadly almost no one follows standards nowadays):So yeah, maybe I missed something obvious, but - how do I filter such websites? I've tried checking the hash -
body_md5
is also not present, but funnily enough httpx still gives out the hash (for an empty 0 byte string) in its output when asked:Both word and line count are 1 for a completely empty body, but they can also be 1 for legitimate short responses, so I can't use them to filter out completely empty responses.
The text was updated successfully, but these errors were encountered: