How do I access sites that don't start with www like:
swbd.netfirms.com
I tried GET / HTTP/1.1\nHost: www.netfirms.com\n\n
But got 503 unknown site.
Also, I want to see if I have the command submission correct. Do I put \n after every command and \n\n after the final command?
[Edited by - Sfpiano on August 8, 2005 2:12:46 PM]
Connecting to a website to obtain it's html
//------------------------------------------------------------------------------------------------------The great logician Bertrand Russell once claimed that he could prove anything if given that 1+1=1. So one day, some fool asked him, "Ok. Prove that you're the Pope." He thought for a while and proclaimed, "I am one. The Pope is one. Therefore, the Pope and I are one."
You put \r\n after each line, and end with an additional blank line (so \r\n\r\n).
For Host, put in the actual site host. If the site is foo.bar.com, then use Host: foo.bar.com\r\n
You probably want to also include a User-Agent: and an Accept: header.
For Host, put in the actual site host. If the site is foo.bar.com, then use Host: foo.bar.com\r\n
You probably want to also include a User-Agent: and an Accept: header.
enum Bool { True, False, FileNotFound };
If you don't use the Host: header, then most of the virtual hosting on the web today won't get right. Also, you can make 1.1 much easier to deal with by sending connection close headers, so the server won't think you'll re-use the connection.
enum Bool { True, False, FileNotFound };
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement