Thank you Yejun.
I have now realized that the problem was that I was mixing strings and
binary bytes in the response. I started with a string header, which
must have initialized the StringIO to ASCII encoding. If I remove that
header, I don't have any errors. I'll change the string header to the
I tried your code. No error whatsoever and working as expected.
On Oct 31, 12:33 pm, Sito <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I can't find a way to write arbitrary binary data in my response. I
> have a big list of ints that I would like to serve in a response as
> compact as possible. For t