Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement msgpack support #176

Closed
wants to merge 2 commits into from
Closed

Implement msgpack support #176

wants to merge 2 commits into from

Conversation

rasky
Copy link

@rasky rasky commented Nov 8, 2013

This patch implements support for msgpack (http://msgpack.org).

MsgPack is a binary transport for schemaless data structures. It can be thought as a binary serialization of JSON, though this is not formally a correct definition. MsgPack is very popular in Japan and is increasingly used as a compact serialization / data storage format.

The present patch makes httpie understands the "application/x-msgpack" content type, and decode it appropriately to the standard output. It is very useful when working with an API that implements this serialization format.

Testsuite is OK after this patch is applied.

To support content types with binary data, there are
two different modifications needed:

1) We need to postpone response body decoding into unicode until
the output processor is run. Making it before (with the 'replace'
substitution policy) would mean scrambling the binary data.
2) We need to postpone the binary check (used for output
suppression) until the output processors have run. In fact, binary
processors might decode the data into something readable that
doesn't need to be suppressed.
@jkbrzt
Copy link
Member

jkbrzt commented Nov 8, 2013

Thanks, @rasky! It looks useful. It would be better to have this as a plugin though since it has an external dependency. I'm already planning on adding a plugin API also for output processors like this one. See #177.

@rasky
Copy link
Author

rasky commented Nov 8, 2013

OK I'm happy to adapt the code once you have the plugin API out for this. Let me know how it goes.

@rasky
Copy link
Author

rasky commented Dec 4, 2014

Resubmitted as #284

@rasky rasky closed this Dec 4, 2014
@rasky rasky deleted the msgpack branch December 4, 2014 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement planned Solution is being worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants