HTTP stands for Hypertext Transfer Protocol, the application-layer protocol used to transfer data between clients and servers on the web.
It defines how browsers, APIs, applications, and servers format requests and responses when exchanging resources such as HTML pages, JSON data, images, files, and other content.
Also known as: Hypertext Transfer Protocol.
HTTP follows a request-response model.
A typical interaction looks like this:
A simplified flow looks like:
Client
↓
HTTP Request
↓
Server
↓
HTTP Response
↓
Client
An HTTP request is a message sent by a client to a server.
A request may contain:
For example:
GET /products HTTP/1.1
Host: example.com
Accept: application/json
This request asks the server for the /products resource.
An HTTP response is the message returned by the server.
It may contain:
For example:
HTTP/1.1 200 OK
Content-Type: application/json
The response body may then contain structured data such as:
{
"product": "Wireless Mouse",
"price": 29.99
}
HTTP methods describe the action a client wants to perform.
GET retrieves a resource.
Typical uses include:
Load a webpage
Retrieve API data
Download a file
POST sends data to the server.
It is commonly used for:
Submitting forms
Creating records
Sending API requests
PUT is commonly used to replace or update an existing resource.
PATCH is typically used to make a partial update to a resource.
DELETE requests removal of a resource.
HEAD requests response headers without the full response body.
OPTIONS asks the server which communication methods or options are supported.
HTTP status codes indicate the result of a request.
They are grouped into several categories.
These codes indicate that a request has been received and processing is continuing.
These indicate successful requests.
Common examples include:
200 OK
201 Created
204 No Content
These tell the client that additional action may be required.
Common examples include:
301 Moved Permanently
302 Found
304 Not Modified
These indicate a problem with the request.
Common examples include:
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
429 Too Many Requests
These indicate that the server failed to complete a valid request.
Common examples include:
500 Internal Server Error
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
HTTP headers provide metadata about requests and responses.
Common request headers include:
Host
User-Agent
Accept
Authorization
Cookie
Content-Type
Common response headers include:
Content-Type
Content-Length
Cache-Control
Set-Cookie
Server
Location
Headers can control authentication, caching, content negotiation, cookies, and other behaviors.
Some HTTP methods can include a request body.
For example, a client may send JSON data:
{
"name": "Wireless Mouse",
"price": 29.99
}
The Content-Type header can indicate the data format:
Content-Type: application/json
HTTP and HTTPS use the same general request-response model, but HTTPS adds encryption through TLS.
In simple terms:
HTTPS helps protect information such as:
Modern websites commonly use HTTPS rather than unencrypted HTTP.
HTTP and TCP operate at different layers.
HTTP defines how web requests and responses are structured.
TCP provides reliable transport between systems.
In simple terms:
Traditional HTTP versions commonly operate over TCP.
HTTP has evolved through several versions.
HTTP/1.1 introduced persistent connections and remains widely supported.
HTTP/2 improved efficiency through features such as:
Multiple requests can share a single connection more effectively.
HTTP/3 uses QUIC instead of traditional TCP transport.
It is designed to reduce connection latency and improve performance under changing network conditions.
HTTP is the foundation of many web APIs.
An application may use methods such as:
GET Retrieve records
POST Create records
PATCH Update records
DELETE Remove records
API responses commonly use structured formats such as JSON.
For example:
{
"id": 1001,
"name": "Wireless Mouse",
"available": true
}
HTTP traffic can be routed through a proxy server.
A simplified connection may look like:
Client
↓
HTTP Proxy
↓
Destination Server
The proxy receives the client's request and forwards it to the destination.
Depending on the proxy configuration, it may:
HTTP is fundamental to web scraping and API-based data collection.
A typical workflow may look like:
Send HTTP Request
↓
Receive HTTP Response
↓
Check Status Code
↓
Parse Response
↓
Extract Required Data
↓
Store Results
For server-rendered pages, the required data may be available directly in the HTTP response.
For JavaScript-heavy applications, additional browser rendering may be needed after the initial HTTP request.
Automated systems should interpret HTTP status codes before processing a response.
For example:
200 → Process response
404 → Resource not found
429 → Request rate exceeded
500 → Server error
Different errors may require different responses, such as retrying later, skipping the resource, or recording the failure for analysis.
Suppose a client requests product information.
The request may look like:
GET /products/1001 HTTP/1.1
Host: example.com
Accept: application/json
The server may return:
HTTP/1.1 200 OK
Content-Type: application/json
with the following body:
{
"id": 1001,
"name": "Wireless Mouse",
"price": 29.99,
"currency": "USD"
}
The client can then parse the response and use the product information in an application or data pipeline.
HTTP, or Hypertext Transfer Protocol, is the core application-layer protocol used for communication between web clients and servers.
It defines how requests and responses are structured through methods, headers, status codes, and message bodies. HTTP powers webpages, APIs, proxies, and many web data workflows, while HTTPS adds encryption to protect data in transit.