Request Line RFC 9110

GET method /index.html request-target HTTP/1.1 version CRLF
GET /index.html HTTP/1.1\r\n
MethodSafeIdempotentBody
GETYesYesNo
HEADYesYesNo
POSTNoNoYes
PUTNoYesYes
DELETENoYesNo
OPTIONSYesYesOptional

Request Headers field-name: field-value

Host: example.com\r\n
User-Agent: Mozilla/5.0\r\n
Accept: text/html,application/xhtml+xml\r\n
Accept-Language: en-US,en;q=0.9\r\n
Accept-Encoding: gzip, deflate, br\r\n
Connection: keep-alive\r\n
\r\n
HeaderDefault (if omitted)
HostRequired in HTTP/1.1
Connectionkeep-alive
Accept*/*
Accept-Encodingidentity (no compression)
Cache-Controlheuristic caching

Status Line RFC 9110

HTTP/1.1 version 200 status OK reason CRLF
RangeClassExample
1xxInformational100 Continue
2xxSuccess200 OK, 201 Created
3xxRedirection301 Moved, 304 Not Modified
4xxClient Error400 Bad Request, 404 Not Found
5xxServer Error500 Internal, 503 Unavailable

Response Headers field-name: field-value

Date: Fri, 27 Dec 2025 12:00:00 GMT\r\n
Content-Type: text/html; charset=utf-8\r\n
Content-Length: 1256\r\n
Server: Apache/2.4\r\n
Cache-Control: max-age=3600\r\n
\r\n
HeaderDefault (if omitted)
Content-Typeapplication/octet-stream
Content-Lengthchunked or connection close
Transfer-Encodingidentity
Connectionkeep-alive

Message Structure Content-Type, Content-Length

Status Line Headers CRLF CRLF (blank line) Body
ExtensionContent-Type
.htmltext/html
.csstext/css
.jstext/javascript
.jsonapplication/json
.pngimage/png
(unknown)application/octet-stream

URL Structure RFC 3986

https scheme :// example.com host : 443 port /path/file path ? q=test query # top fragment
SchemeDefault Port
http80
https443
ftp21