HttpWebRequest.GetResponse()

O

Oemer Yildiz

Hi,

how does GetResponse() act (request-method is GET!), when the
Content-Length of the HTTP-Response is -1, i.e. unlimited? Using a
Packet-Sniffer i found out, that it returns after having received the
HTTP-header and a few packets from the data-stream. However, i'd like
to know the method's "documented" behaviour which i could not find on
its documentation page.

Thanks in advance!
 
N

Nicole Schenk

Oemer said:
Hi,

how does GetResponse() act (request-method is GET!), when the
Content-Length of the HTTP-Response is -1, i.e. unlimited? Using a
Packet-Sniffer i found out, that it returns after having received the
HTTP-header and a few packets from the data-stream. However, i'd like
to know the method's "documented" behaviour which i could not find on
its documentation page.

Thanks in advance!
I would look into http://www.w3c.org, they may have the http standard.
 
J

Joerg Jooss

Oemer said:
Hi,

how does GetResponse() act (request-method is GET!), when the
Content-Length of the HTTP-Response is -1, i.e. unlimited?

-1 does not mean unlimited -- there's no such thing as an unlimited
response size. It means "undefined". You may see this value for a
number of reasons, such as

-- The response has no body (like any request for a HEAD request)
-- The response was sent using Transfer-Encoding: chunked
-- The response included a Connection: close header
Using a
Packet-Sniffer i found out, that it returns after having received the
HTTP-header and a few packets from the data-stream. However, i'd like
to know the method's "documented" behaviour which i could not find on
its documentation page.

It will do just what needs to be done according to the HTTP 1.1
protocol. Do you have a specific problem?

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top