When an HTTP client sends a request to a webserver, looking like this:
GET /index.html HTTP/1.1
Host: www.example.com
and the server responds with simething like this: (examples taken from Wikipedia)
HTTP/1.1 200 OK
Date: Mon, 23 May 2005 22:38:34 GMT
Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
ETag: "3f80f-1b6-3e1cb03b"
Content-Type: text/html; charset=UTF-8
Content-Length: 131
Accept-Ranges: bytes
Connection: close
<html>
<head>
<title>An Example Page</title>
</head>
<body>
Hello World, this is a very simple HTML document.
</body>
</html>
The response contains the field Content-Type: text/html; charset=UTF-8
. But this only tells the encoding of the bytes after the empty line in the response.
What charset do the request and the response header (everything before the empty line) have? Are they ASCII or UTF-8 or any other charset?