In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
HTTP connection process request method request header HTTP Request Header request header status code message structure cookie, session and tokencookiesessionToken
Http://www.runoob.com/http/http-messages.html
HTTP connection process
Cymbal
The request method type describes the page information specified by the GET request and returns the entity body. POST submits data to the specified resource for processing requests (such as submitting a form or uploading a file). The data is contained in the request body. POST requests may result in the creation of new resources and / or modification of existing resources. OPTIONS allows clients to view the performance of the server. HEAD is similar to a get request, except that there is no specific content in the response returned, which is used to get the data sent by the header PUT from the client to the server instead of the contents of the specified document. DELETE requests the server to delete the specified page. The CONNECTHTTP/1.1 protocol is reserved for proxy servers that can change connections to pipelines. TRACE echoes requests received by the server, mainly for testing or diagnosis. Request header HTTP Request Header request header Header request header explanation example Accept specifies the content type Accept: text/plain that the client can receive, and the character encoding set Accept-Charset: iso-8859-5Accept-Encoding that can be accepted by the text/htmlAccept-Charset browser specifies the web server that the browser can support to return the content compression encoding type Accept-Encoding: compress, gzipAccept-Language browser acceptable language Accept-Language: en ZhAccept-Ranges can request one or more sub-scope fields of the web entity Accept-Ranges: bytesAuthorizationHTTP authorization certificate Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==Cache-Control specifies that the caching mechanism Cache-Control: no-cacheConnection that the request and response follow indicates whether a persistent connection is required. (HTTP 1.1 defaults to persistent connections) Connection: when a closeCookieHTTP request is sent, all cookie values saved under the request domain name are sent to the web server. Cookie: $Version=1; Skin=new Content length of the Content-Length request Content-Length: MIME information corresponding to the entity of the 348Content-Type request Content-Type: date and time when the application/x-www-form-urlencodedDate request was sent Date: Tue 15 Nov 2010 08:12:31 specific server behavior of GMTExpect request Expect: 100-continueFrom EmailFrom of the requesting user: user@email.comHost specifies the domain name and port number of the requested server Host: www.zcmhi.comIf-Match is valid only if the content of the request matches the entity If-Match: "737060cd8c284d8af7ad3082f209582d" If-Modified-Since the request succeeds if the part of the request is modified after the specified time If not modified, return code If-Modified-Since: Sat, 29 Oct 2010 19:43:31 GMTIf-None-Match if the content has not changed, the parameter is the Etag previously sent by the server, and compare with the Etag responded by the server to determine whether to change the If-None-Match: "737060cd8c284d8af7ad3082f209582d" If-Range if the entity has not changed, the server sends the lost part of the client, otherwise it sends the whole entity. The parameter is also EtagIf-Range: "737060cd8c284d8af7ad3082f209582d" If-Unmodified-Since successfully requested only if the entity has not been modified after the specified time If-Unmodified-Since: Sat, 29 Oct 2010 19:43:31 GMTMax-Forwards limit the time when information is sent through agents and gateways Max-Forwards: 10Pragma is used to contain the authorization certificate that implements a specific directive Pragma: no-cacheProxy-Authorization to connect to the agent Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==Range requests only a portion of the entity Specify the range Range: bytes=500-999Referer address of the previous web page, followed by the current request web page, that is, the source Referer: http://www.zcmhi.com/archives/71.htmlTE client is willing to accept the transmission code, and notify the server to accept the trailing header information TE: trailers,deflate Q=0.5Upgrade specifies a transport protocol to the server for conversion (if supported) the contents of Upgrade: HTTP/2.0, SHTTP/1.3, IRC/6.9, RTA/x11User-AgentUser-Agent contain the user information that made the request User-Agent: Mozilla/5.0 (Linux X11) Via notifies intermediate gateway or proxy server address, communication protocol Via: 1.0,1.1 nowhere.com (Apache/1.1) Warning warning message about message entity Warn: 199Miscellaneous warning status code status code description 200OK indicates that the request has been processed normally by the server 204No Content indicates that the request has been successfully processed, but no content is returned, that is, there is no message entity in the returned response message 301Moved Permanently permanent redirection will not occur on the browser page, indicating that the requested resource has been permanently moved to another location, that is, the resource has been assigned to a new URI302Found temporary redirection, indicating that the requested resource has been temporarily moved to another location and temporarily assigned to a new URI400Bad Request. It means that there is a syntax error or parameter error in the request message, and the server does not understand that the server should not submit the request repeatedly. 401Unauthorized indicates that the request sent requires HTTP authentication information or if authentication fails, the response returned must contain a WWW-Authenticate header applicable to the requested resource to challenge the user information 403Forbidden to indicate that the access to the requested resource has been denied by the server 404Not Found indicates that the server cannot find the resource you requested 500Internal Server Error indicates that the server made an error in executing the request It may be that the Web application has bug or temporary failure 503Service Unavailable indicates that the server is overloaded or is downtime for maintenance, and cannot handle the request message structure.
Cymbal
Cookie, session and tokencookie
Cookie is divided into 'session' and 'persistent' cookie
Session cookie: a temporary cookie that has no expiration time and is deleted when the user exits the browser. Cannot be shared by browsers. (often used to save sessionID) persistent cookie: a cookie that is stored on a hard disk and usually has an expiration time, and if it expires, the cookie is deleted. Can be shared by browsers
The principle of cookie is as follows:
Cymbal
Advantages:
It is saved on the client side and does not occupy server resources.
Disadvantages:
The security level is the lowest of the three, and it is easy to be hijacked and exploited by browsers. There is a limit on the size and quantity of storage. Session cannot be used in places where cookie is disabled.
Session: also known as session control. Is to store the properties and configuration information required for a specific user session. When the user jumps between the Web pages of the application, the variables stored in the Session object are not lost, but persist throughout the user session.
The principle of session is as follows:
Cymbal
Advantages:
It is safer than cookie. The storage object can be controlled flexibly.
Disadvantages:
There is a problem of session sharing in distributed systems. It needs to be solved by redis and so on. Because session exists in cookie, it also inherits the shortcomings of cookie. Token
Https://my.oschina.net/jamesfancy/blog/1613994 explains token in great detail in this article.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 261
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.