Link to home
Start Free TrialLog in
Avatar of wesunivofmd
wesunivofmd

asked on

Requesting webpage from webserver

When you open i.e. or any web browser and enter a URL and submit the request to any webserver, "WHAT" is sent?  When I say what, I mean I know that were making a call (request) for maybe a specific webpage as follows:

Open I.E.
Enter: http://www.yahoo.com/ in the URL area
Click enter or submit

I know that the request for the above URL will return the default webpage (index.html or whatever) that the webserver has set up.  But "WHAT" does the webserver receive?  Does the webserver receive a text file that has request information?

ASKER CERTIFIED SOLUTION
Avatar of humeniuk
humeniuk
Flag of Canada 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
It can be very interesting (and useful) to see what exactly is passing back and forth between a client and a web server.

Try downloading the IIS Resource Kit Tools from the following link:
http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499&DisplayLang=en

There is a utility called wfetch in there that will allow you to craft and send requests from basic get requests to complex requests with additional headers and body elements to any given webserver and see exactly what is sent back.

For example, this is what you would see for a standard GET request to http://www.yahoo.com:

started....
resolve hostname "www.yahoo.com"
WWWConnect::Connect("216.109.118.72","80")\n
source port: 4853\r\n
REQUEST: **************\n
GET / HTTP/1.1\r\n
Host: www.yahoo.com\r\n
Accept: */*\r\n
\r\n
RESPONSE: **************\n
HTTP/1.1 200 OK\r\n
Date: Mon, 04 Oct 2004 02:38:57 GMT\r\n
P3P: policyref="http://p3p.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV"\r\n
Cache-Control: private\r\n
Vary: User-Agent\r\n
Connection: close\r\n
Transfer-Encoding: chunked\r\n
Content-Type: text/html\r\n
\r\n
<html>
*** Actual page contents deleted for brevity***
></html>\n
\n
<!-- p9.www.dcn.yahoo.com uncompressed/chunked Sun Oct  3 19:38:57 PDT 2004 -->\n
WWWConnect::Close("216.109.118.72","80")\n
closed source port: 4853\r\n
finished.

Kinda cool, huh?  :-)

Hope this helps.....

Dave Dietz
Avatar of wesunivofmd
wesunivofmd

ASKER

Thanks, humeniuk
Glad to be able to help out a little.  Good luck.

Thanks to Dave, too.  That's a handy tool.