Home All Groups Group Topic Archive Search About

HttpWebRequest.GetResponse()

Author
30 Mar 2006 2:38 PM
MrMikeInNH
Hi all,

I am curious that if I create an HttpWebRequest object and set the
Method of it to "HEAD", when I call GetResponse() do I get the whole
document sent from the responding server or do I just get the Headers
of the document I requested? Would this also mean, that I don't
actually download any of the body of the document until I call
GetResponseStream() on the HttpWebResponse object? I'm trying to limit
how much data I download, as I really only need to get the URI from the
HttpWebResponse object, not the entire page.

Thanks,
Mike

Author
30 Mar 2006 4:47 PM
Kevin Spencer
Hi Mike,

The answer is that you will only get the head. See:

http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.

<MrMikeI***@gmail.com> wrote in message
Show quote
news:1143729510.943860.171210@j33g2000cwa.googlegroups.com...
> Hi all,
>
> I am curious that if I create an HttpWebRequest object and set the
> Method of it to "HEAD", when I call GetResponse() do I get the whole
> document sent from the responding server or do I just get the Headers
> of the document I requested? Would this also mean, that I don't
> actually download any of the body of the document until I call
> GetResponseStream() on the HttpWebResponse object? I'm trying to limit
> how much data I download, as I really only need to get the URI from the
> HttpWebResponse object, not the entire page.
>
> Thanks,
> Mike
>
Author
30 Mar 2006 5:33 PM
MrMikeInNH
Thanks! I thought that's what the documentation was saying but just
wanted some reassurance on it.

AddThis Social Bookmark Button