报文
request message
request message header
request line
syntax:<em style="color: rgb(0, 0, 0); font-family: Consolas, "Lucida Console", "Courier New", Courier, monospace; text-align: left; margin: 0px; padding: 0px;">request-method-name</em><span style="color: rgb(0, 0, 0); font-family: Consolas, "Lucida Console", "Courier New", Courier, monospace; text-align: left; margin: 0px; padding: 0px; background-color: rgb(199, 226, 250);"> </span><em style="color: rgb(0, 0, 0); font-family: Consolas, "Lucida Console", "Courier New", Courier, monospace; text-align: left; margin: 0px; padding: 0px;">request-URI</em><span style="background-color: rgb(199, 226, 250); color: rgb(0, 0, 0); font-family: Consolas, "Lucida Console", "Courier New", Courier, monospace; text-align: left;"> </span><em style="color: rgb(0, 0, 0); font-family: Consolas, "Lucida Console", "Courier New", Courier, monospace; text-align: left; margin: 0px; padding: 0px;">HTTP-version</em>
request methods:
get
head: <span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;">to get the header that a GET request would have obtained. Since the header contains the last-modified date of the data, this can be used to check against the local cache copy.</span>
post: post data up to web servers
put: ask web severs to store the data
delete: ask web servers to delete the data
trace: <span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;">Ask the server to return a diagnostic trace of the actions it takes.</span>
options: <span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;"> Ask the server to return the list of request methods it supports.</span>
connect:<span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;">Used to tell a proxy to make a connection to another host and simply reply the content, without attempting to parse or cache it. This is often used to make SSL connection through the proxy.</span>
other extension methods
request headers
<pre class="code-syntax" style="margin-top: 5px; margin-bottom: 6px; padding: 3px 10px; border: 2px solid rgb(248, 248, 248); font-family: Consolas, "Lucida Console", "Courier New", Courier, monospace; font-size: 13px; color: rgb(0, 0, 0); line-height: 16.9px; text-align: left; background-color: rgb(199, 226, 250);"><em style="margin: 0px; padding: 0px;">request-header-name</em>: <em style="margin: 0px; padding: 0px;">request-header-value1</em>, <em style="margin: 0px; padding: 0px;">request-header-value2</em>, ...</pre>
request message body(optional)
response message
response message header
status line
syntax: <em style="color: rgb(0, 0, 0); font-family: Consolas, "Lucida Console", "Courier New", Courier, monospace; text-align: left; margin: 0px; padding: 0px;">HTTP-version</em><span style="background-color: rgb(199, 226, 250); color: rgb(0, 0, 0); font-family: Consolas, "Lucida Console", "Courier New", Courier, monospace; text-align: left;"> </span><em style="color: rgb(0, 0, 0); font-family: Consolas, "Lucida Console", "Courier New", Courier, monospace; text-align: left; margin: 0px; padding: 0px;">status-code</em><span style="background-color: rgb(199, 226, 250); color: rgb(0, 0, 0); font-family: Consolas, "Lucida Console", "Courier New", Courier, monospace; text-align: left;"> </span><em style="color: rgb(0, 0, 0); font-family: Consolas, "Lucida Console", "Courier New", Courier, monospace; text-align: left; margin: 0px; padding: 0px;">reason-phrase</em>
response headers
<pre class="code-syntax" style="margin-top: 5px; margin-bottom: 6px; padding: 3px 10px; border: 2px solid rgb(248, 248, 248); font-family: Consolas, "Lucida Console", "Courier New", Courier, monospace; font-size: 13px; color: rgb(0, 0, 0); line-height: 16.9px; text-align: left; background-color: rgb(199, 226, 250);"><em style="margin: 0px; padding: 0px;">response-header-name</em>: <em style="margin: 0px; padding: 0px;">response-header-value1</em>, <em style="margin: 0px; padding: 0px;">response-header-value2</em>, ...</pre>
response message body(optional)
contain resource data requested
request methods
GET(case sensitive)
head: <span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;">to get the header that a GET request would have obtained. Since the header contains the last-modified date of the data, this can be used to check against the local cache copy.</span>
post: post data up to web servers
put: ask web severs to store the data
delete: ask web servers to delete the data
trace: <span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;">Ask the server to return a diagnostic trace of the actions it takes.</span>
options: <span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;"> Ask the server to return the list of request methods it supports.</span>
connect:<span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;">Used to tell a proxy to make a connection to another host and simply reply the content, without attempting to parse or cache it. This is often used to make SSL connection through the proxy.</span>
other extension methods
response status code(3-digit number)
1xx<span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;"> (Informational): Request received, server is continuing the process.</span>
2xx<span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;">(Success): The request was successfully received, understood, accepted and serviced.</span>
3xx<span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;">(Redirection): Further action must be taken in order to complete the request.</span>
4xx<span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;">(Client Error): The request contains bad syntax or cannot be understood.</span>
5xx<span style="color: rgb(0, 0, 0); font-family: "Segoe UI", Segoe, Calibri, Tahoma, Arial, Helvetica, Verdana, sans-serif; font-size: 14px; text-align: justify;">(Server Error): The server failed to fulfill an apparently valid request.</span>