Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
HTTP
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== HTTP/1.1 response messages <span class="anchor" id="Response_message"></span> == A response message is sent by a server to a client as a reply to its former request message.{{refn|group=note|name=http-23-message}} === Response syntax === A server sends ''response messages'' to the client, which consist of:<ref name="rfc9112-2.1" /> * a '''status line''', consisting of the protocol version, a [[Space (punctuation)|space]], the [[List of HTTP status codes|response status code]], another space, a possibly empty reason phrase, a [[carriage return]] and a [[line feed]], e.g.: *: <syntaxhighlight lang="http"> HTTP/1.1 200 OK </syntaxhighlight> * zero or more [[HTTP response header field|response header fields]], each consisting of the case-insensitive field name, a colon, optional leading [[Whitespace (computer science)|whitespace]], the field value, an optional trailing whitespace and ending with a carriage return and a line feed, e.g.: *: <syntaxhighlight lang="http"> Content-Type: text/html </syntaxhighlight> * an empty line, consisting of a carriage return and a line feed; * an optional [[HTTP message body|message body]]. === Response status codes === {{See also|List of HTTP status codes}} In HTTP/1.0 and since, the first line of the HTTP response is called the ''status line'' and includes a numeric ''status code'' (such as "[[HTTP 404|404]]") and a textual ''reason phrase'' (such as "Not Found"). The response status code is a three-digit integer code representing the result of the server's attempt to understand and satisfy the client's corresponding request. The way the client handles the response depends primarily on the status code, and secondarily on the other response header fields. Clients may not understand all registered status codes but they must understand their class (given by the first digit of the status code) and treat an unrecognized status code as being equivalent to the x00 status code of that class. The standard ''reason phrases'' are only recommendations, and can be replaced with "local equivalents" at the [[web developer]]'s discretion. If the status code indicated a problem, the user agent might display the ''reason phrase'' to the user to provide further information about the nature of the problem. The standard also allows the user agent to attempt to interpret the ''reason phrase'', though this might be unwise since the standard explicitly specifies that status codes are machine-readable and ''reason phrases'' are human-readable. The first digit of the status code defines its class: ; <code>1XX</code> (informational): The request was received, continuing process. ; <code>2XX</code> (successful): The request was successfully received, understood, and accepted. ; <code>3XX</code> (redirection): Further action needs to be taken in order to complete the request. ; <code>4XX</code> (client error): The request contains bad syntax or cannot be fulfilled. ; <code>5XX</code> (server error): The server failed to fulfill an apparently valid request. === Response header fields === {{see also|List of HTTP header fields#Response fields}} The response header fields allow the server to pass additional information beyond the status line, acting as response modifiers. They give information about the server or about further access to the target resource or related resources. Each response header field has a defined meaning which can be further refined by the semantics of the request method or response status code.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)