Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

WebResponse Class

Provides a response from a Uniform Resource Identifier (URI). This is an abstract class.

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)
public abstract class WebResponse : IDisposable

The WebResponse type exposes the following members.

  NameDescription
Protected methodSupported by Silverlight for Windows PhoneWebResponseInitializes a new instance of the WebResponse class.
Top
  NameDescription
Public propertySupported by Silverlight for Windows PhoneContentLengthWhen overridden in a descendant class, gets or sets the content length of data being received.
Public propertySupported by Silverlight for Windows PhoneContentTypeWhen overridden in a derived class, gets or sets the content type of the data being received.
Public propertySupported by Silverlight for Windows PhoneHeadersWhen overridden in a derived class, gets a collection of header name-value pairs associated with this request.
Public propertySupported by Silverlight for Windows PhoneResponseUriWhen overridden in a derived class, gets the URI of the Internet resource that actually responded to the request.
Public propertySupported by Silverlight for Windows PhoneSupportsHeadersGets a value that indicates whether the Headers property is supported by the descendant class for the WebResponse instance.
Top
  NameDescription
Public methodSupported by Silverlight for Windows PhoneCloseWhen overridden by a descendant class, closes the response stream.
Public methodSupported by Silverlight for Windows PhoneDispose()Releases the resources used by the current instance of the WebResponse class.
Protected methodDispose(Boolean)Called by the Dispose() and Finalize() methods to release the managed and unmanaged resources used by the current instance of the WebResponse class.
Public methodSupported by Silverlight for Windows PhoneEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneGetResponseStreamWhen overridden in a descendant class, returns the data stream from the Internet resource.
Public methodSupported by Silverlight for Windows PhoneGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneToStringReturns a string that represents the current object. (Inherited from Object.)
Top

The WebResponse class is the abstract base class from which protocol-specific response classes are derived. Applications can participate in request and response transactions in a protocol-agnostic manner using instances of the WebResponse class while protocol-specific classes derived from WebResponse carry out the details of the request.

Client applications do not create WebResponse objects directly; they are created by calling the BeginGetResponse method on a WebRequest instance.

Notes to Inheritors

When you inherit from WebResponse, you must override the following members: ContentLength, ContentType, Close, GetResponseStream, Headers, and ResponseUri.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Windows Phone OS 7.0

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.