web server / HTTP protocol basis

1.http protocol: a specification and conventions, the client and server communicate the 
2.http request format: Request line request header + body + request
method + request-URI + http- version: request line
method requested resource address + + http version of the
request header:
the Accept: refers to the browser or other client can take the love of MIME file format. Analyzing it can Servlet and return the appropriate file format.

User-Agent: browser is the client name

Host: name and port number of the corresponding Web URL in the URL.

Accept-Langeuage: point out the browser can accept the kind of language, such as en or en-us, refers to English.

connection: used to tell whether the server can maintain a constant HTTP connection. http is connectionless, HTTP / 1.1 Keep-Alive use default values, so that when (such as an HTML file and the associated graphics files) browser needs multiple files, do not need to establish a connection every time

Cookie: browser with this property Cookie sent to the server. Cookie is registered in the browser small data volume, the user may specify that the information relative to the server, a session can be used to implement the function.

Referer: URL shown to produce the requested page. As the ratio from click /icconcept/index.jsp a link to a page / icwork / search, send a GET request to the server / icwork / search in the middle, Referer is http: // hostname: 8080 / icconcept / index. jsp. This property can be used to track Web request is from what site come.

User-Agent: is the name of the client browser.

Content-Type: type name for the table of contents of the request.

Accept-Charset: pointed out that the browser can accept the character encoding. The default value is English browser-8859-1 ISO.

The Accept-Encoding: encoding pointed out that the browser can accept. Unlike encoding file format, which is to archive file delivery speed and acceleration. Browser early decoding after receiving the response from the Web, and then check the file format.
Request body:
format 3.http response: Response status line + header + body response
status line: the HTTP-Version + + the Status-Code Reason-Phrase
HTTP status code + + version text description of the status code
response header: Server + Date + content-type + last-Moified + content-length
server content-type + date + + + last-modified date content length
response body
4.TCP principle: three-way handshake (a connection) four times and waved (release resources)
5. mainstream web server uses epoll technology such that a plurality of single-process single-threaded socket connector and simultaneous working process is characterized by the network operating system and communication through the memory (memory mapped), using event handling (substituted in rotation)
6.TCP / the IP protocol suite: a layered structure
application layer HTTP,
the transport layer TCP, UDP
network layer ICMP, IP, IGMP, ARP, RARP
Network interface layer

7. The process of a browser to access the server:
enter the domain name
DNS server to resolve the domain name
and server TCP connection
to send HTTP request data
waiting for the server response
to the server broken link

Guess you like

Origin www.cnblogs.com/burningcarbon/p/11220197.html