How an HTTP server responds to a HEAD request for encoded encoding

I have a question about what the response of the HTTP server looks like when HEAD is sent to the resource, and the server decided to execute the encoded encoding?

If the server always wants to perform encoded encoding for GET on a specific resource, since it does not know the exact length of the content when generating a response, how the server should behave when HEAD is sent to the same resource.

+4
source share
2 answers

Transfer-Encoding . HEAD , Transfer-Encoding ; GET.

+3

W3C:

, HTTP HEAD, , GET.

, GET Transfer-Encoding: chunked, HEAD .

:

curl -I http://www.google.com/ # -I sends HEAD request

HTTP/1.1 200 OK Date: Fri, 09 Jan 2015 17:56:05 GMT Expires: -1 Cache-Control: private, max-age=0 Content-Type: text/html; charset=ISO-8859-1 Server: gws X-XSS-Protection: 1; mode=block X-Frame-Options: SAMEORIGIN Alternate-Protocol: 80:quic,p=0.02 Transfer-Encoding: chunked

0

Source: https://habr.com/ru/post/1547539/


All Articles