I'm considering adding support for Protocol Buffers to the RESTful application that I'm currently working on, and was wondering what people thought.
I'm aware of all the arguments against using binary formats in REST APIs - but we deal with some pretty big sets of data on our project, and the speed and compactness of Protocol Buffers compared to XML/JSON is just too tempting. So here's how I'm thinking we might implement things:
- XML will remain the default representation for all resources.
- If the client includes the
application/x-protobufMIME type in their
Acceptheader, the server will return a Protocol Buffer instead (and set the
- When a Protocol Buffer is returned, the HTTP response will also include an
X-Protobuf-Schemaheader containing the URI for the