Http url format, request message introduction, protocol url
The URL format of the HTTP protocol is as follows:
Https: // host [":" port] [abs_path]: http indicates that network resources are located through HTTP; host indicates that a valid Internet host domain name or IP address 'port specifies a port number. If it is null, the default port 80 is used. abs_path specifies the URL of the requested resource. If the URL does not provide abs_path, when it is used as the request URI, it must be given in the form of "/". Generally, this work will be automatically completed by the browser.
HTTP Request Message (HttpRequest ):
An HTTP request consists of three parts:
HTTP request line: the request line starts with a method character and is separated by spaces, followed by the request URI and Protocol version. The format is: method Request-uri http -- Version CRLF (carriage return and line feed, except as the ending CRLF, separate CR or LF characters are not allowed ).
HTTP message header
HTTP Request body
HTTP Response Message (HttpResponse ):
Status line: format, HTTP-Version Status-Code Reason-Phrase CRLF
Message Header
Response body