Search code examples
apicontent-typeapi-designcbor

How to deal with encoding content-type formats in an API?


I am designing an API that supports the following content-types: JSON, Protobuf and XML.

When I want to send plain JSON I would use: application/json. Would this be valid too: cbor/json if I want to sent through JSON encoded as CBOR?


Solution

  • Per the mime type registry and RFC 7049, use application/cbor.