Learn/Glossary/Request / Response
HTTP & APIs

Request / Response

The classic communication pattern where a client initiates a request message and a server replies with a response message.

Diagram

  Client (Request)                       Server (Response)
  ──────────────────────────────────     ──────────────────────────────────
  GET /api/v1/users HTTP/1.1             HTTP/1.1 200 OK
  Host: api.myapp.com              ──▶   Content-Type: application/json
  Authorization: Bearer xyz              Content-Length: 42
                                   ◀──
                                         {"status": "healthy"}

In Depth

The Request-Response pattern is the fundamental communication style of the web. It requires a client to initiate a socket connection, send a request message, and wait for the server to send a response message back before closing or reusing the connection.

Related Terms