Media types

As everyone knows, clients and servers normally exchange resource representations. Typically, in a POST request, the request body contains a representation for a resource to be created. On the reverse side, in a GET request, the response body contains a representation of the received resource. Generally, formats are specified through the use of media types (alternatively termed MIME types). For non-binary data, it's JSON (media type = application/json) and XML (media type = application/xml). The Content-Type header in a request or response specifies the format of the representation.

Having understood the relevance of APIs for creating composite enterprises, IT professionals have unearthed a number of API design patterns, which ...

Get Hands-On RESTful API Design Patterns and Best Practices now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.