How does the communication between a browser and a web server take place?

后端 未结 8 1741
梦谈多话
梦谈多话 2020-12-12 10:51

Can anyone explain how the communication takes place between the browser and web server? I want to learn how

  • GET, POST verbs (among others)
  • cookies
8条回答
  •  旧时难觅i
    2020-12-12 11:30

    The links for specifications of each aspect of the question is as follows:

    • GET, POST verbs (among others) - The HTTP Specification exhaustively discusses all aspects of HTTP communication (the protocol for communication between the web server and the browser). It explains the Request message and Response message protocols.

    • Cookies - are set by attaching a Set-Cookie HTTP Header to the HTTP response.

    • QueryStrings - are the part of the URL in the HTTP request that follow the first occurrence of a "?" character. The linked specification is for section 3.4 of the URI specification.

    • Sessions - HTTP is a synchronous, stateless protocol. Sessions, or the illusion of state, can be created by (1) using cookies to store state data as plain text on the client's computer, (2) passing data-values in the URL and querystring of the request, (3) submitting POST requests with a collection of values that may indicate state and, (4) storing state information by a server-side persistence mechanism that is retrieved by a session-key (the session key is resolved from either the cookie, URL/Querystring or POST value collection.

    An explanation of HTTP can go on for days, but I have attempted to provide a concise yet conceptually complete answer, and include the appropriate links for further reading of official specifications.

提交回复
热议问题