JavaWeb: http protocol format and the common request method

B / S: browser, server, web pages, protocols HTTP protocol: fixed format is essentially a string of a string and parsing. Browser to the server sends the data call request (request) the server sends to the browser in response to the data call (response) server only passively receives a request sent by the browser, the corresponding process in response to the request and (necessarily responds) HTTP request data format: request line (http request method, the requested URL, HTTP version), format of the request header, a blank line, the message body of the response: status line (http version, response code, a response descriptor), in response to the first , blank lines, commonly used in the message body http get request methods and post: get: used to retrieve information from the server, because the web server can restrict url full length of 255, it can send large amounts of information. There are two ways, with participation manner without reference method. With reference data is part of the embodiment of the url, the request path followed by?, Then the key-way, multiple parameters are separated by the & symbol. So no message body content. post: for transmitting data to the server, and the process specified in claim url. Data portion of the seat can be an unlimited number of http request, transmitted via the socket connection. As data is not part of the url. Used to send sensitive information or large amounts of information, upload files. Query string or form data in the message body.

Guess you like

Origin www.cnblogs.com/libobo22/p/12018421.html