HTTP protocol
Hypertext Transfer Protocol HyperText Transfer Protocol
Four characteristics :
1, 2 a primary response request, based on TCP / IP protocol, the role of the application layer 3, 4 stateless, connectionless
Data Format:
1, the request format (line 4 ) requests the first line (request method, protocol version) request header (key - value key-value pairs) blank lines request body (carrying the data may be blank, depending on the manner set request )
Request mode:
get request (ask for the data to the server, such as opening a URL) POST request (to submit data to the server, such as a login function)
2, in response format (line 4) in response to the first line (response status codes) in response to the first (key - value key-value pairs) blank line in response to the body (see browser displayed to the user data)
Response status code:
1xx represents the server has received the client's data is being processed, you can continue to submit data. 2xx: 200 which indicates that the request has been successful server returns the requested data. 3xx: Redirection (the original visit is A, the result turned to B). 4xx: in which 403 said they did not have the requested conditions are not qualified to access; 404: that the requested resource does not exist. 5xx which represents 500 internal server error