Hands-On RESTful API Design Patterns and Best Practices
by Harihara Subramanian J, Anupama Murali, Pethuru Raj
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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access