Skip to content
uencoder

HTTP

HTTP (HyperText Transfer Protocol) is the application-layer protocol of the Web, built on a request-response model, stateless, and the foundation of web communication.

Purpose

It provides the application-layer protocol for distributed hypermedia systems, with flexible content negotiation and caching.

Mechanism

The client sends a request (method GET/POST/PUT/DELETE + URL + headers + body) and the server returns a response (status code + headers + body). It is stateless (cookies carry sessions). HTTP/2 adds multiplexing, HTTP/3 builds on QUIC, and HTTP/1 is a text protocol.

Use cases

  • Web page and API communication
  • RESTful API
  • File download and upload
  • WebSocket upgrades

Examples

  • Input
    GET /api/users HTTP/1.1
    Output
    200 OK + JSON body

    Request-response

Common errors

Using GET for operations with side effects
Use POST/PUT/DELETE for state-changing operations

Related terms

Related tools

References