Provides an HTTP-specific implementation of the WebResponse class.
public ref class HttpWebResponse : System::Net::WebResponse
public ref class HttpWebResponse : System::Net::WebResponse, System::Runtime::Serialization::ISerializable
public ref class HttpWebResponse : System::Net::WebResponse, IDisposable, System::Runtime::Serialization::ISerializable
public class HttpWebResponse : System.Net.WebResponse
public class HttpWebResponse : System.Net.WebResponse, System.Runtime.Serialization.ISerializable
[System.Serializable]
public class HttpWebResponse : System.Net.WebResponse, IDisposable, System.Runtime.Serialization.ISerializable
[System.Serializable]
public class HttpWebResponse : System.Net.WebResponse, System.Runtime.Serialization.ISerializable
type HttpWebResponse = class
inherit WebResponse
type HttpWebResponse = class
inherit WebResponse
interface ISerializable
[<System.Serializable>]
type HttpWebResponse = class
inherit WebResponse
interface ISerializable
interface IDisposable
[<System.Serializable>]
type HttpWebResponse = class
inherit WebResponse
interface ISerializable
Public Class HttpWebResponse
Inherits WebResponse
Public Class HttpWebResponse
Inherits WebResponse
Implements ISerializable
Public Class HttpWebResponse
Inherits WebResponse
Implements IDisposable, ISerializable
The following example returns an HttpWebResponse from an HttpWebRequest.
HttpWebRequest HttpWReq =
(HttpWebRequest)WebRequest.Create("http://www.contoso.com");
HttpWebResponse HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();
// Insert code that uses the response object.
HttpWResp.Close();
Dim HttpWReq As HttpWebRequest = _
CType(WebRequest.Create("http://www.contoso.com"), HttpWebRequest)
Dim HttpWResp As HttpWebResponse = _
CType(HttpWReq.GetResponse(), HttpWebResponse)
' Insert code that uses the response object.
HttpWResp.Close()
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.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.
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 the HttpWebResponse class.
The contents of the response from the Internet resource are returned as a Stream by calling the GetResponseStream method.
Constructors Properties CharacterSetGets the character set of the response.
ContentEncodingGets the method that is used to encode the body of the response.
ContentLengthGets the length of the content returned by the request.
ContentTypeGets the content type of the response.
CookiesGets or sets the cookies that are associated with this response.
HeadersGets the headers that are associated with this response from the server.
IsFromCacheGets a Boolean value that indicates whether this response was obtained from the cache.
(Inherited from WebResponse) IsMutuallyAuthenticatedGets a Boolean value that indicates whether both client and server were authenticated.
LastModifiedGets the last date and time that the contents of the response were modified.
MethodGets the method that is used to return the response.
ProtocolVersionGets the version of the HTTP protocol that is used in the response.
ResponseUriGets the URI of the Internet resource that responded to the request.
ServerGets the name of the server that sent the response.
StatusCodeGets the status of the response.
StatusDescriptionGets the status description returned with the response.
SupportsHeadersGets a value that indicates whether headers are supported.
Methods Explicit Interface Implementations See alsoRetroSearch 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