HttpWebRequest.GetResponse()

  • Thread starter Thread starter Oemer Yildiz
  • Start date Start date
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!
 
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.
 
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,
 
Back
Top