Provides an HTTP-specific implementation of the WebResponse class.
Assembly: System (in System.dll)
Obsolete.Initializes a new instance of theclass.
Gets the character set of the response.
Gets the method that is used to encode the body of the response.
Gets the length of the content returned by the request.(Overrides WebResponse::ContentLength.)
Gets the content type of the response.(Overrides WebResponse::ContentType.)
Gets or sets the cookies that are associated with this response.
Gets the headers that are associated with this response from the server.(Overrides WebResponse::Headers.)
Gets the last date and time that the contents of the response were modified.
Gets the method that is used to return the response.
Gets the version of the HTTP protocol that is used in the response.
Gets the URI of the Internet resource that responded to the request.(Overrides WebResponse::ResponseUri.)
Gets the name of the server that sent the response.
Gets the status of the response.
Gets the status description returned with the response.
Gets a value that indicates if headers are supported.(Overrides WebResponse::SupportsHeaders.)
Closes the response stream.(Overrides WebResponse::Close().)
Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.)
Releases the unmanaged resources used by the WebResponse::Dispose(Boolean).), and optionally disposes of the managed resources.(Overrides
Determines whether the specified object is equal to the current object.(Inherited from Object.)
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)
Serves as the default hash function. (Inherited from Object.)
Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.)
This API supports the product infrastructure and is not intended to be used directly from your code. Populates a SerializationInfo with the data needed to serialize the target object.(Overrides WebResponse::GetObjectData(SerializationInfo^, StreamingContext).)
Gets the contents of a header that was returned with the response.
Gets the stream that is used to read the body of the response from the server.(Overrides WebResponse::GetResponseStream().)
Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.)
Returns a string that represents the current object.(Inherited from Object.)
This API supports the product infrastructure and is not intended to be used directly from your code. Serializes this instance into the specified SerializationInfo object.
This class contains support for HTTP-specific uses of the properties and methods of the WebResponse class. The class is used to build HTTP stand-alone client applications that send HTTP requests and receive HTTP responses.
Do not confuse HttpResponse class that is used in ASP.NET applications and whose methods and properties are exposed through ASP.NET's intrinsic Response object.with the
You should never directly create an instance of the HttpWebRequest::GetResponse. You must call either the Stream::Close or the HttpWebResponse::Close method to close the response and release the connection for reuse. It is not necessary to call both Stream::Close and HttpWebResponse::Close, but doing so does not cause an error.class. Instead, use the instance returned by a call to
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 common HTTP headers that are available through properties of theclass.
The following example returns an HttpWebRequest.from an
Available since 4.5
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.