HTTP messages consist of requests from client to server and responses from server.
OPTIONS GET HEAD POST PUT DELETE TRACE CONNECT
Request-URI = "*" | absoluteURI | abs_path | authority
absoluteURI
form is required when the request is made to a proxy, GET http://www.w3.org/pub/WWW/TheProject.html HTTP/1.1
authority
form is only used by the CONNECT
methodtransparent proxies must not rewrite the abs_path
part of the received Request-URI when forwarding
GET /pub/WWW/TheProject.html HTTP/1.1
Host: www.w3.org
Part of requests and responses, contains fields defining the operating parameters of an HTTP transaction
Accept: text/plain
Accept-Charset: utf-8
Host: en.wikipedia.org
domain nameUser-Agent:
stringCache-Control:
comma delimited list of response directives:private || public
, whether or not it should be cachedno-cache
, cache should revalidate this resource every timeexpires
etag
, response header, critical for caching and used for conditional requests (invoking 304s)vary
pragma: no-cache
Location
header is returned to ask a web browser to load a different web page (URL redirection) or sent with HTTP status codes 3xx
301
is a permanent redirect, when content is moved forever, browser should always request the new URL instead302
is a temporary redirect, tell the browser that the content is temporarily located at a different location, but they should continue to attempt the original URL on later requests304 not modified
, the conditional GET request would have received 200 OK
, but the condition was false.minimize the amount of information transfer to the client
416
request range not satisfiable2015 revision of the protocol, provided improvements to network efficiency and enabled real-time communication through long-lived connections