Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

client request

I read as follows

http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Example_session



Client request
 GET /index.html HTTP/1.1
 Host: www.example.com

A client request (consisting in this case of the request line and only one header) is followed by a blank line, so that the request ends with a double newline, each in the form of a carriage return followed by a line feed. The "Host" header distinguishes between various DNS names sharing a single IP address, allowing name-based virtual hosting. While optional in HTTP/1.0, it is mandatory in HTTP/1.1.

I have not understood clearly what it means.

 Please advise
Any ideas, suggestions, sample code, links, source code highly appreciated. Thanks in advance
Avatar of girionis
girionis
Flag of Greece image

A client request (consisting in this case of the request line and only one header) is followed by a blank line, so that the request ends with a double newline, each in the form of a carriage return followed by a line feed.

It means that after the

Host: www.example.com 

line it's like you press enter twice (so you have two newlines).

The "Host" header distinguishes between various DNS names sharing a single IP address, allowing name-based virtual hosting. While optional in HTTP/1.0, it is mandatory in HTTP/1.1.

It means that the same IP can have two DNS. For instance the well known localhost IP 127.0.0.1 may have many DNS in the hosts file, like

127.0.0.1 myapp
127.0.0.1 myapp2

The host header distinguishes between them two. If host is "myapp" then the request goes to myappp, and so on.

This was optional in HTTP 1.0 but it's mandatory in HTTP 1.1.
Avatar of gudii9

ASKER

i am trying to digest...
Avatar of gudii9

ASKER

>>It means that the same IP can have two DNS.

How one IP can have multiple DNS and why it is optional and how they used to handle in HTTP1.0
I am not clear on above. Please advise
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial