liveBook · Manning

HTTP

As explained in The Design of Web APIs, Second Edition

HTTP is the Hypertext Transfer Protocol, a standardized synchronous request–response protocol for exchanging resources and messages between clients and servers.

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.
figure

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

How The Design of Web APIs, Second Edition covers it

How deep it goes
Explains request–response basics, resource paths, methods, status codes, data locations, semantic correctness, and version efficiency.
Examples
Uses browser, curl, Python requests, blog retrieval, product search, and CRUD-style resource paths as concrete HTTP examples.
What you can do after
Apply it via curl or Python requests to retrieve resources and design API operations with appropriate paths, methods, inputs, outputs, and statuses.
How it connects
Connects HTTP with REST APIs, web APIs, clients, servers, resources, methods, status codes, request bodies, and response bodies.

Also explained in

Compare how 8 books explain HTTP →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of The Design of Web APIs, Second Edition. The section links point to the parts of the book it draws on.