Printer Friendly Version      Send     
Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Silverlight
.NET Framework Class Library for Silverlight
HttpWebResponse Class
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Provides an HTTP-specific implementation of the WebResponse class.

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

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

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.

Note:

Do not confuse HttpWebResponse with the HttpResponse class that is used in ASP.NET applications and whose methods and properties are exposed through ASP.NET's intrinsic Response object.

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 Stream..::.Close or the HttpWebResponseClose()()() method to close the response and release the connection for reuse. It is not necessary to call both Stream..::.Close and HttpWebResponseClose()()(), 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. Other headers 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.

System..::.Object
  System.Net..::.WebResponse
    System.Net..::.HttpWebResponse
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker