.NET Framework Class Library for Silverlight
HttpWebResponse Class

Provides an HTTP-specific implementation of the WebResponse class.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)
Syntax

Visual Basic (Declaration)
Public MustInherit Class HttpWebResponse _
    Inherits WebResponse
Visual Basic (Usage)
Dim instance As HttpWebResponse
C#
public abstract class HttpWebResponse : WebResponse
Remarks

This class contains support for HTTP-specific uses of the properties and methods of the WebResponse class. The HttpWebResponse class is used to build HTTP stand-alone client applications that send HTTP requests and receive HTTP responses.

You should never directly create an instance of the HttpWebResponse class. Instead, use the instance returned by a call to HttpWebRequest..::.BeginGetResponse.

You must call either the Close or Stream..::.Close method to close the response and release the connection for reuse. It is not necessary to call both the Close and the Stream..::.Close method, but doing so does not cause an error.

Common header information returned from the Internet resource is exposed as properties of the class. See the following table for a complete list. Headers for the request can be read from the Headers property as name/value pairs.

The following table shows the values that are available through properties of the HttpWebResponse class.

Header

Property

HTTP method

Method

Status code

StatusCode

Status description

StatusDescription

The contents of the response from the Internet resource are returned as a Stream by calling the GetResponseStream method.

Inheritance Hierarchy

System..::.Object
  System.Net..::.WebResponse
    System.Net..::.HttpWebResponse
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

Tags :


Page view tracker