Name
WebResponse
Synopsis
This class represents a response received from a WebRequest
.
A response consists of headers (stored as key/value pairs in the Headers
property) and a response
body. You can obtain the response body as a System.IO.Stream
using the GetResponseStream()
method.
When you are finished with the response, call its Close()
method; this releases any open resources
still held by the WebResponse
without having to wait
for garbage collection to do so (which could take longer than desired).
Public MustInherit Class WebResponse : Inherits MarshalByRefObject : Implements System.Runtime.Serialization.ISerializable, IDisposable ' Protected Constructors Protected Sub New() Protected Sub New( ByVal serializationInfo As System.Runtime.Serialization.SerializationInfo, ByVal streamingContext As System.Runtime.Serialization.StreamingContext) ' Public Instance Properties Overridable Public Property ContentLength As Long Overridable Public Property ContentType As String Overridable Public ReadOnly Property Headers As WebHeaderCollection Overridable Public ReadOnly Property ResponseUri As Uri ' Public Instance Methods Overridable Public Sub Close() Overridable Public Function GetResponseStream() As Stream End Class
Hierarchy
System.Object→System.MarshalByRefObject→ WebResponse(System.Runtime.Serialization.ISerializable
, System.IDisposable)
Subclasses
FileWebResponse
, HttpWebResponse
Returned By
WebException.Response
, WebRequest.{EndGetResponse()
, GetResponse()}
Passed To
WebException.WebException() ...
Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.