Provides a response from a Uniform Resource Identifier (URI). This is an abstract
class.
public ref class WebResponse abstract : IDisposable
public ref class WebResponse abstract : MarshalByRefObject, IDisposable, System::Runtime::Serialization::ISerializable
public abstract class WebResponse : IDisposable
public abstract class WebResponse : MarshalByRefObject, IDisposable, System.Runtime.Serialization.ISerializable
[System.Serializable]
public abstract class WebResponse : MarshalByRefObject, IDisposable, System.Runtime.Serialization.ISerializable
type WebResponse = class
interface IDisposable
type WebResponse = class
inherit MarshalByRefObject
interface IDisposable
interface ISerializable
type WebResponse = class
inherit MarshalByRefObject
interface ISerializable
interface IDisposable
[<System.Serializable>]
type WebResponse = class
inherit MarshalByRefObject
interface ISerializable
interface IDisposable
Public MustInherit Class WebResponse
Implements IDisposable
Public MustInherit Class WebResponse
Inherits MarshalByRefObject
Implements IDisposable, ISerializable
The following example creates a WebResponse instance from a WebRequest.
// Initialize the WebRequest.
WebRequest myRequest = WebRequest.Create("http://www.contoso.com");
// Return the response.
WebResponse myResponse = myRequest.GetResponse();
// Code to use the WebResponse goes here.
// Close the response to free resources.
myResponse.Close();
' Initialize the WebRequest.
Dim myRequest As WebRequest = WebRequest.Create("http://www.contoso.com")
' Return the response.
Dim myResponse As WebResponse = myRequest.GetResponse()
' Code to use the WebResponse goes here.
' Close the response to free resources.
myResponse.Close()
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 GetResponse method on a WebRequest instance.
Notes to ImplementersWhen you inherit from WebResponse, you must override the following members: ContentLength, ContentType, GetResponseStream(), ResponseUri, and Headers.
Constructors Properties ContentLengthWhen overridden in a descendant class, gets or sets the content length of data being received.
ContentTypeWhen overridden in a derived class, gets or sets the content type of the data being received.
HeadersWhen overridden in a derived class, gets a collection of header name-value pairs associated with this request.
IsFromCacheGets a Boolean value that indicates whether this response was obtained from the cache.
IsMutuallyAuthenticatedGets a Boolean value that indicates whether mutual authentication occurred.
ResponseUriWhen overridden in a derived class, gets the URI of the Internet resource that actually responded to the request.
SupportsHeadersGets a value that indicates if headers are supported.
Methods Explicit Interface ImplementationsRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4