First, the HTTP protocol
· HTTP --Hypertext Transfer Protocol
· HTTP messages include the client's request message to the server and the server's corresponding message to the client
• The process of exchanging information between the browser and the server
• Establish a connection
• Send request Information
• Return response information
• Close the connection
· HTTP protocol is a stateless protocol.
· HTTP1.1 supports persistent connections, one connection can send multiple requests
• The so-called stateless means that this request response has no relation to the next request response
· HTTP basic format of request
1) Request Line
2) Request Header
3) Request entity (whenpost is submitted, there will be a request entity, andtheget method commits without requesting the entity)
4) Get way through request row parameter, can pass the amount of information is small, unsafe
5) Post through the entity parameters, can be transmitted a large amount of information, security
· HTTP basic format of response
1) Status line
2) One or more answer heads
3) a blank line
4) Response Entity
5) Connection: Used to specify whether the connection needs to be maintained after the request response has been processed
6) Date: The time the current message was generated
7) Pragma and cache-control: Cache Required
8) content-length: The length of the request/response body
Servlet--http