Sign in to follow this  
ArchG

GET Request not returning what it should

Recommended Posts

ArchG    327
Hi, I've recently made a small program that connects to a server and does a GET Request, but it often returns kinda crazy results, like for example this: Connect to: www.metroeguide.net Get Request: "GET /admin.asp HTTP/1.1\r\nHost:me.me.com\r\n\r\n" It will return me a 415 Unsupported Media message, but if you browse there in IE or any other browser (www.metroeguide.net/admin.asp), that is obviously not the case. It is something to do with the headers i'm sending? (I truthfully have no idea what i'm suppose to send in that part.) It also screw up on many other websites Any help would be great, thanks! [Edited by - ArchG on June 5, 2005 8:29:03 PM]

Share this post


Link to post
Share on other sites
nprz    692
Well, first, the page forwards you to /admin/admin.asp, so you should try there instead.
second: Host:me.me.com should be changed! Host:www.metroeguide.net is the host.

web sniffer This helped me figure out how the header should be formed.

Share this post


Link to post
Share on other sites
Michalson    1657
Whatever docs you are using to learn the HTTP 1.1 protocol, throw them out. The field "host" (required in 1.1) refers to the host you are contacting, meaning it should be www.metroeguide.net

I suggest you read something like HTTP Made Really Easy, or even consider making simplier HTTP 1.0 requests unless you have a need for persistent connections and are going to be supporting all the 1.1 encoding and connection related complexity.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this