--------- HTTP front-end basis heart note

   HTTP

HTTP protocol (HyperText Transfer Protocol, Hypertext Transfer Protocol) is the most widely used on the Internet A network transport protocol, all WWW documents must comply with this standard.
HTTP is a data transfer to a TCP / IP communication protocol

HTTP works

HTTP protocol works on the client - server architecture on.
Browser as an HTTP client URL that is WEB server sends all requests to the server via HTTP.
There are Web servers: Apache server, IIS server (Internet Information Services) and so on.
Web server according to the received request, transmits the response information to the client. The default HTTP port number is 80, but you can also be changed to 8080 or other ports.


HTTP Three things to note:

HTTP is a connectionless: Meaning No limitation is attached only one request per connection. After the server processes client requests and receives the customer's response, i.e., disconnected. In this way it can save transmission time.
HTTP is an independent media: This means that, as long as the client and the server knows how to handle the data content of any type of data can be sent via HTTP. The client and server specify the appropriate MIME-type content type.
HTTP is a stateless: HTTP protocol is stateless protocol. No state is no protocol for transaction processing and memory. If the lack of state means that the subsequent processing required in front of the information, it must be retransmitted, which may result in the amount of data transmitted for each connection is increased. On the other hand, when it does not require previous information in response to a faster server.


     HTTP message structure

HTTP uses uniform resource identifier (Uniform Resource Identifiers, URI) to transmit data and establish a connection.

    Client request message
client sends a request to the server HTTP request message comprises the following format: request line (request line), the request header (header), a blank line and request data four parts

 

Server response message

HTTP response also consists of four parts, namely: a status line, message header, and response body blank line.

HTTP Working distance: a handshake, a request, response, rendering, disconnect.
HTTP request message: the REQUEST

Request line (GET HTTP / 1.1)
request header
empty line
request data; null

GET and POST distinction
after the data filed on the GET URL to? URL and transmit the divided data, is connected to between & parameter, such as the file http://127.0.0.1/ .php? Name = Age = 12 is zhangsan &&,
POST method data submitted in the body of the HTTP packet
data size is limited GET submitted (the browser restrictions on the length of the URL) and POST method to submit no limit to the
GET method to submit data, can create security issues.


the cookie features:
file size 4kb
read have a domain name restrictions: Do not cross-domain, you need the same domain, with the port, the same host name, with the agreement of
quantitative restrictions is generally about 50
statute of limitations: each cookie will have a prescription, valid for the shortest session level

Guess you like

Origin www.cnblogs.com/hudunyu/p/11685483.html