HTTP, the Hypertext Transfer Protocol, is a synchronous request–response protocol for exchanging resources and messages between clients and servers. Standardized methods describe actions such as retrieving or sending resources, while responses report processing results and return data. HTTP works across programming languages, server technologies, and client types. section 3.1.1 section 1.1.2
Figure 3.2 A browser or curl command loads a web page by sending an HTTP request containing a standard method and a path identifying the page. The server returns with an HTTP response confirming that the page is found and its content.
A browser or curl command sends a method and path; the server returns a status and requested content. section 3.1.1
Represent an operation by deciding:
- Which resource path identifies the target, such as /products or /products/{element identifier}. section 4.1.2 section 4.3.6
- Which standardized method expresses the action, such as GET, POST, PUT, PATCH, or DELETE. section 4.1.2 section 4.3.6
- Where inputs and outputs belong, such as query parameters for filters and a response body for product information. section 4.1.2
- Which status code communicates the result, such as 200 OK for success or 404 Not Found for a missing resource. section 4.1.2 section 3.1.3
Searching an online catalog
A mobile application or curl sends GET /products with filter data in the query. The server returns 200 OK and structured product information, regardless of how the data is stored. The same request pattern can serve a web application, command-line client, or smart refrigerator. section 3.1.2
Using HTTP semantics improves interoperability and user-friendliness. A REST API uses HTTP extensively and treats products or messages as resources, but REST is not the only web API style; SOAP, GraphQL, and gRPC use HTTP differently. HTTP/2 and later improve compression, binary transmission, persistent connections, and parallel requests compared with HTTP/1.1, without changing the basic request, response, method, and status model. section 3.1.3 section 13.2.1







