RESTful API

Home > Computer Science > Web development (Computer Science) > RESTful API

A web service that uses HTTP methods to interact with data.

HTTP methods: GET, POST, PUT, DELETE: These are the most commonly used HTTP methods that RESTful APIs rely on to perform CRUD (Create, Read, Update, Delete) operations.
HTTP status codes: These codes inform a client about the status of the requested resource, whether the request was successful or not.
Request and response bodies: These are the contents of data sent between the client and server in the form of JSON or XML.
MIME types: MIME (Multipurpose Internet Mail Extension) types refer to the formats for data transmission, such as text, HTML, JSON, or XML.
URI (Uniform Resource Identifier): RESTful APIs use a URI scheme to specify the location of resources to provide easy discovery and access to information.
Authentication and authorization: These mechanisms ensure that users are authorized to access specific resources over the web via APIs.
Pagination: This is a technique that enables the partitioning of large data sets into smaller, more manageable pages to improve performance.
Hypermedia and HATEOAS: Hypermedia allows the API to provide links and other related resources that enable navigating to other related resources. HATEOAS (Hypermedia As The Engine Of Application State) gives the API client information about available actions.
Caching: This technique reduces server strain by allowing the client to cache the response from the server and use it again.
Cross-Origin Resource Sharing (CORS): CORS enables a web page to request resources from a different domain outside its original domain.
Versioning: This is the process of managing changes to the API and ensuring that newer versions are backward compatible with older versions.
API documentation: Documenting an API is essential in providing the user with enough information about the API, its endpoints, and how to use it.
JSON-RPC API: A JSON-RPC API is the one that uses JSON-RPC protocol to perform remote procedure calls (RPCs). It is simple and lightweight and mainly used in client-server communication over HTTP.
SOAP API: SOAP (Simple Object Access Protocol) API is a message protocol and specification to exchange structured information in web service communication. It uses XML format for data exchange and functions as a middleware layer between applications.
GraphQL API: GraphQL API is a query language or a data integration system between client and server. It enables the client to express its data retrieval needs more precisely, reducing the amount of data transfer, and promoting performance.
XML-RPC API: XML-RPC API (Remote Procedure Call) is a protocol to communicate with a client over HTTP or HTTPS using XML language. It is widely used in API intercommunication between different languages and platforms.
JSON API: JSON API is a specification for building APIs in JSON format. It provides efficient data retrieval and reduces redundancy between data types, allowing better caching and faster data transfer.
HAL API: Hypertext Application Language is an API format used to create links between related resources in JSON or XML format. It is a simple way to provide connectivity between resources and provides a better client experience when navigating between these resources.
OData API: Open Data Protocol is a REST-based API that enables the query and update of data in a standardized and interoperable way using HTTP requests. It supports various data sources such as databases, file systems, and web services.
HATEOAS API: Hypermedia As The Engine Of Application State is a REST-based API that allows a client to navigate through available resources and actions from a server. It makes use of hyperlinks to navigate between the resources, making it more discoverable and more easily maintainable.
Envelope API: An Envelope API is a method of structuring responses in a consistent format to make it easier for the clients to consume the API. It helps in presenting resource data, metadata, and errors in a uniform manner.
"REST defines a set of constraints for how the architecture of an Internet-scale distributed hypermedia system, such as the Web, should behave."
"The REST architectural style emphasizes the scalability of interactions between components, uniform interfaces, independent deployment of components, and the creation of a layered architecture to facilitate caching of components."
"REST has been employed throughout the software industry to create stateless, reliable Web-based applications."
"An application that obeys the REST constraints may be informally described as RESTful."
"Although this term is more commonly associated with the design of HTTP-based APIs and what are widely considered best practices."
"The creation of a layered architecture to facilitate caching of components to reduce user-perceived latency."
"Scalability of interactions between components, uniform interfaces, independent deployment of components, and the creation of a layered architecture."
"Enforce security and encapsulate legacy systems."
"This term is more commonly associated with the design of HTTP-based APIs."
"The main purpose of REST is to guide the design and development of the architecture for the World Wide Web."
"REST defines a set of constraints for how the architecture of an Internet-scale distributed hypermedia system, such as the Web, should behave."
"An application that obeys the REST constraints may be informally described as RESTful as it is stateless."
"REST has been employed throughout the software industry to create stateless, reliable Web-based applications."
"The creation of a layered architecture [...] to enforce security."
"The REST architectural style emphasizes the independent deployment of components."
"...a layered architecture to facilitate caching of components."
"REST encapsulates legacy systems."
"The REST architectural style emphasizes uniform interfaces."
"The REST architectural style emphasizes the scalability of interactions between components."
"This term is often even at odds with the concept [of REST] as originally formulated."