What is the mandatory information a HTTP Request Header must contain?
What is the mandatory information a HTTP Request Header must contain ?
Solution 1:
GET / HTTP/1.0
is a legal HTTP request.
If there's no Host
header field, you may not get the results you were hoping for if the destination server is a virtual host that doesn't have its own IP address to distinguish itself from other virtual hosts.
HTTP 1.1 requires the Host
field.
Solution 2:
None of the HTTP Headers are required in an HTTP/1.0
Request. There are no required Response headers either.
All that and more in HTTP 1.1 - RFC 2616