Hypertext Transfer Protocol - Web Communication Standard
HTTP (Hypertext Transfer Protocol) is an application-layer protocol for distributed, collaborative, hypermedia information systems. It's the foundation of data communication for the World Wide Web.
Each request is independent and doesn't retain information about previous requests.
Client sends requests, server responds with data or status information.
Human-readable protocol that's easy to debug and understand.
Retrieve data from server
Send data to server
Update existing resource
Remove resource
| Header | Type | Description | Example |
|---|---|---|---|
| Content-Type | Response | Media type of the resource | application/json |
| User-Agent | Request | Client application info | Mozilla/5.0... |
| Host | Request | Target server hostname | example.com |
| Accept | Request | Acceptable response types | application/json |
| Cache-Control | Both | Caching directives | no-cache |
| Content-Length | Response | Size of response body | 1024 |
| Authorization | Request | Authentication credentials | Bearer token123 |
| Accept-Encoding | Request | Acceptable compression | gzip, deflate |
| Content-Encoding | Response | Compression used | gzip |
| Connection | Both | Connection control | keep-alive |
| Set-Cookie | Response | Cookie to set | session=abc123 |
| Cookie | Request | Cookies to send | session=abc123 |
| Location | Response | Redirect URL | https://example.com/new |
| Referer | Request | Previous page URL | https://google.com |
| Accept-Language | Request | Preferred languages | en-US, en |
| X-Forwarded-For | Request | Client IP address | 192.168.1.1 |
| ETag | Response | Resource version identifier | "abc123" |
| If-None-Match | Request | Conditional request | "abc123" |
| Server | Response | Server software info | nginx/1.18.0 |
| X-Requested-With | Request | AJAX request indicator | XMLHttpRequest |
HTTP has evolved through several versions, each bringing new features and improvements to web communication.