Responses
Aside from the first response line, called the status line, responses are formatted very similarly to requests. While different headers are used in requests and responses, they are formatted the same way. A blank line separates the headers and the body in both requests and responses. The body may be absent in either depending on what the request operation is. Below is an example response. HTTP/1.0 200 OK Date: Mon, 21 Jul 2008 02:32:52 GMT Server: Apache X-Powered-By: PHP/5.2.5 Cache-Control: private, s-maxage=0, max-age=0, must-revalidate Content-Language: en Last-Modified: Mon, 21 Jul 2008 02:06:27 GMT Content-Length: 53631 Content-Type: text/html; charset=utf-8 Connection: close [body...] Aside from headers, the main difference in content between requests and responses is in the contents of the request line versus the status line.
Status codes are divided into five classes distinguished by the first digit of the code. Below is a brief summary of each class. See section 10 of RFC 2616 for further descriptions of circumstances under which specific status codes may be received.
Moving right along, let us examine headers in more depth. © HTTP — Web Scraping >>> Back to TABLE OF CONTENTS <<< | |
Views: 433 | |
Total comments: 0 | |