Hands-On RESTful API Design Patterns and Best Practices
by Harihara Subramanian J, Anupama Murali, Pethuru Raj
Flexibility
The data from the API should be independent of resources or methods. It implies REST API should handle multiple types of calls and return various data formats, even with some change in the structure representing hypermedia. In other words, the data of the API response isn't tied to the resources or methods.
The GitHub API summary representations and detailed representations may be examples of API flexibility. List of repository API GET /orgs/myorg/repos gets the summary representation, and single repository API GET /repos/myorg/myhelloworld.rb fetches the detailed description of the indicated repository.
The Salesforce API provides flexibility with its response formats, so API developers can serialize the data in either XML or ...
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