Now widely used is the http/1.1 version, released in 1997.
Understanding the HTTP protocol begins with the request, such as:
Post/form/entry http/1.1
format : request method URI Protocol version
Request Method :
get: Gets the resource specified by the URI, the main purpose is to obtain
POST: Transfers the principal to a URI, the primary purpose of which is to transmit , not to get
PUT: Transfers A file , contains the contents of the file in the request body, and then saves to the location specified by the URI.
head: Gets the head of the get result only, removing the body.
Delete: remove file , is put inverse operation
Options: Query The method that specifies the resource support for the request URI. Usage such as:
OPTIONS * http/1.1
Host:xxx
Note : Because the put and delete methods involve direct manipulation of server files , the general web site is not supported.
Unless a web authentication mechanism is used with the.
Common Status Codes :
1XX: Indicates a message
2XX: Success
The OK request succeeds, and the content is returned
204 No content: Requests are processed successfully, but nothing is returned
206:partial content: The server sends back a range of contents as requested by the client.
3XX: redirect
301:moved permanently: The requested resource has been permanently assigned a new URI, this time with the new URI access
302:found: The requested resource has been temporarily assigned a new URI, this time with a new URI access
As you can see, either 301 or 302, the requested resource has two URIs
303:see Other: Similar to 302, request resource has a new URI, get to obtain
304:not Modified: The resource was found but did not meet the conditions contained in the request message (not related to redirection)
4XX: Client Error
400:bad Request: There is a syntax error in the requested message
401:unauthorized: No authentication information is included in the sent request, or authentication failed
403:forbidden: Access denied (such as permissions and other issues)
404:not Found: No URI specified resource on the server
5XX: Server Error
500:internal Server error: Server side errors occurred while executing the request
503:service Unavailable: The server is unable to process the request (server is overloaded or maintenance, etc.)
HTTP protocol----Request method and Status code