learn / Term explained
EN

Requests and Access · Explanation of Terms

HTTP requests and responses

HTTP request and response

Common writing methods: HTTP, request header, response header

What it means

A client requests a resource over HTTP, and the server returns a message with a status code, response headers and an optional body. This is a basic form of communication in web scraping.

The request method, URL, request headers and request body together describe an operation. The response status code describes the processing result; the response header describes the content type, cache, or other meta-information; the response body may be HTML, JSON, an image, or it may be empty.

Getting an HTML response does not mean that the browser has executed the page script. There may be significant differences between the original response obtained by the HTTP client and the content of the page later rendered by the browser.

Checked 2026-12-04: HEAD requests metadata without response content. RFC 9110 says a server must not send content, and may omit headers calculated only while generating it. If Content-Length is included, it describes the bytes that a corresponding GET would send, not a body received with HEAD. Hypothetically, HEAD with Content-Length: 3495 can have no body at all. A successful HEAD is not proof that GET returns the expected article or that scripts have rendered it.

In a scraping task

First confirm what is returned

Check the status code and Content-Type before collecting. If you expect JSON but get an HTML login page, you should handle the session or interface address instead of continuing to parse the response as product data.

GET /catalog?page=2 HTTP/1.1
Host: example.com
Accept: text/html

Common misconceptions

  • 200 only means that the request was successfully processed, but does not mean that the returned content must comply with the collection task.
  • Redirects, empty responses, and error responses need to be handled separately, and you can't just check if there is text.

References

Organized by Northleaf Studio. The source link retains the original address to facilitate continued reading.

Back to glossary