You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying to use Slumber with an API that exposes both JSON and MessagePack; it works fine with the former but doesn't work at all when I try to write a custom serialiser for the latter.
It looks like Slumber is trying to decode the response as text in slumber.Resource._try_to_serialize_response; because MessagePack is a binary format, requests.utils.guess_json_utf is returning None, and resp.content.decode(None) works exactly as well as one would expect, so the serialiser doesn't even get called and the consumer code gets returned a raw bytestring.
I'm using Slumber 0.7.1 on Python 3.4.3. The code for my MessagePack serialiser is as follows:
I've been trying to use Slumber with an API that exposes both JSON and MessagePack; it works fine with the former but doesn't work at all when I try to write a custom serialiser for the latter.
It looks like Slumber is trying to decode the response as text in
slumber.Resource._try_to_serialize_response
; because MessagePack is a binary format,requests.utils.guess_json_utf
is returningNone
, andresp.content.decode(None)
works exactly as well as one would expect, so the serialiser doesn't even get called and the consumer code gets returned a raw bytestring.I'm using Slumber 0.7.1 on Python 3.4.3. The code for my MessagePack serialiser is as follows:
The text was updated successfully, but these errors were encountered: