GET Request not returning what it should

Started by
3 comments, last by Michalson 18 years, 10 months ago
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]
Advertisement
Quote:Original post by ArchG
but if you browse there in


Sorry I can't be more help.
-------------------------Rayoom Sledge Hammer Productions - Programmer
lol, thanks, i've been screwin up those their there and they're s lately

Corrections made

ratings++
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.
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.

This topic is closed to new replies.

Advertisement