Mono Class Library: System.Net Namespace

System.Net.HttpWebResponse Class

Provides an HTTP-specific implementation of the System.Net.WebResponse class. [Edit]

See Also: HttpWebResponse Members

System.Object
     System.MarshalByRefObject
          System.Net.WebResponse
               System.Net.HttpWebResponse

public class HttpWebResponse : WebResponse

Thread Safety

All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe.

Remarks

Note:

The System.Net.HttpWebResponse class contains support for the properties and methods included in System.Net.WebResponse with additional elements that enable the user to interact directly with the Hypertext Transfer Protocol (HTTP).

Expected usage is that instances of this class are not created directly but are obtained by calling HttpWebRequest.GetResponse . To obtain the response from the Internet resource as a System.IO.Stream , call the HttpWebResponse.GetResponseStream method.

Certain HTTP headers are protected such that the user cannot set them directly in the header collection. Instead, these headers can be set via the properties of the System.Net.HttpWebRequest class or are set by the system. The following table details these protected headers.

HeaderSet by
AcceptHttpWebRequest.Accept
Connection

HttpWebRequest.Connection

HttpWebRequest.KeepAlive

Content-LengthHttpWebRequest.ContentLength
Content-TypeHttpWebRequest.ContentType
ExpectHttpWebRequest.Expect
DateSet to current date by the system.
HostSet to current host by the system.
if-Modified-sinceHttpWebRequest.IfModifiedSince
RangeHttpWebRequest.AddRange(int, int)
RefererHttpWebRequest.Referer
Transfer-Encoding

HttpWebRequest.TransferEncoding

HttpWebRequest.SendChunked

User-AgentHttpWebRequest.UserAgent
[Edit]

Requirements

Namespace: System.Net
Assembly: System (in System.dll)
Assembly Versions: 1.0.x.x, 1.0.5000.0, 2.0.0.0