EN
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.
Ce sujet n'a pas encore été évalué - Évaluez ce sujet

WebResponse Class

April 12, 2014

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

Namespace:  System.Net
Assembly:  System.Net (in System.Net.dll)
'Déclaration
Public MustInherit Class WebResponse _
	Implements IDisposable

The WebResponse type exposes the following members.

  NameDescription
Protected methodWebResponseInitializes a new instance of the WebResponse class.
Top
  NameDescription
Public propertyContentLengthWhen overridden in a descendant class, gets or sets the content length of data being received.
Public propertyContentTypeWhen overridden in a derived class, gets or sets the content type of the data being received.
Public propertyHeadersWhen overridden in a derived class, gets a collection of header name-value pairs associated with this request.
Public propertyResponseUriWhen overridden in a derived class, gets the URI of the Internet resource that actually responded to the request.
Public propertySupportsHeadersGets a value that indicates whether the Headers property is supported by the descendant class for the WebResponse instance.
Top
  NameDescription
Public methodCloseWhen overridden by a descendant class, closes the response stream.
Public methodDisposeReleases the resources used by the current instance of the WebResponse class.
Protected methodDispose(Boolean)Releases the resources used by the WebResponse object, and optionally disposes of the managed resources.
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetResponseStreamWhen overridden in a descendant class, returns the data stream from the Internet resource.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns 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.

Capabilities

If you use this API in your app, you must specify the following capabilities in the app manifest. Otherwise, your app might not work correctly or it might exit unexpectedly.

ID_CAP_NETWORKING

Windows Phone 8, Windows Phone OS 7.1

For more info, see App capabilities and hardware requirements for Windows Phone 8.

Notes to Inheritors

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

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

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

Afficher:
© 2014 Microsoft. Tous droits réservés.