Closed ufobat closed 6 years ago
.content
will decode the incoming data, but you can always get the raw data with .buf
.
right, thanks! but should the response override the $encoding parameter, if the user specifies one?
The $encoding
parameter sets a default that is used if the server doesn't tell you its encoding. I don't think that should change.
With the broken server lying to you, you should a) contact the server's owner and ask them to fix it, and b) just use .buf.decode('latin1')
or whatever to decode it however you want.
Allright :) thanks dir your Feedback!
Hello, I have got a "broken" webserver that offers me a chunk of binary data but unfortunatelly sets this header:
Content-Type: text/plain;charset=UTF-8
. Bechause the $encoding information in the header overrides the $encoding provided in the method call tocontent
it is impossible to fetch the data. ( I was assuming that i could decode $random_data with latin1 )