mscorlib(4.0.0.0) API with additions
System.Net.WebResponse Class Reference

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

Inheritance diagram for System.Net.WebResponse:
[legend]
Collaboration diagram for System.Net.WebResponse:
[legend]

Public Member Functions

virtual void Close ()
 When overridden by a descendant class, closes the response stream. More...
 
void Dispose ()
 Releases the unmanaged resources used by the T:System.Net.WebResponse object. More...
 
virtual Stream GetResponseStream ()
 When overridden in a descendant class, returns the data stream from the Internet resource. More...
 
- Public Member Functions inherited from System.MarshalByRefObject
object GetLifetimeService ()
 Retrieves the current lifetime service object that controls the lifetime policy for this instance. More...
 
virtual object InitializeLifetimeService ()
 Obtains a lifetime service object to control the lifetime policy for this instance. More...
 
virtual ObjRef CreateObjRef (Type requestedType)
 Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. More...
 

Public Attributes

virtual bool IsFromCache => m_IsFromCache
 Gets a T:System.Boolean value that indicates whether this response was obtained from the cache. More...
 
virtual bool IsMutuallyAuthenticated => false
 Gets a T:System.Boolean value that indicates whether mutual authentication occurred. More...
 

Protected Member Functions

 WebResponse ()
 Initializes a new instance of the T:System.Net.WebResponse class. More...
 
 WebResponse (SerializationInfo serializationInfo, StreamingContext streamingContext)
 Initializes a new instance of the T:System.Net.WebResponse class from the specified instances of the T:System.Runtime.Serialization.SerializationInfo and T:System.Runtime.Serialization.StreamingContext classes. More...
 
virtual void GetObjectData (SerializationInfo serializationInfo, StreamingContext streamingContext)
 Populates a T:System.Runtime.Serialization.SerializationInfo with the data that is needed to serialize the target object. More...
 
virtual void Dispose (bool disposing)
 Releases the unmanaged resources used by the T:System.Net.WebResponse object, and optionally disposes of the managed resources. More...
 
- Protected Member Functions inherited from System.MarshalByRefObject
MarshalByRefObject MemberwiseClone (bool cloneIdentity)
 Creates a shallow copy of the current T:System.MarshalByRefObject object. More...
 

Properties

virtual long ContentLength [get, set]
 When overridden in a descendant class, gets or sets the content length of data being received. More...
 
virtual string ContentType [get, set]
 When overridden in a derived class, gets or sets the content type of the data being received. More...
 
virtual Uri ResponseUri [get]
 When overridden in a derived class, gets the URI of the Internet resource that actually responded to the request. More...
 
virtual WebHeaderCollection Headers [get]
 When overridden in a derived class, gets a collection of header name-value pairs associated with this request. More...
 
virtual bool SupportsHeaders [get]
 Gets a value that indicates if headers are supported. More...
 

Detailed Description

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

Definition at line 10 of file WebResponse.cs.

Constructor & Destructor Documentation

◆ WebResponse() [1/2]

System.Net.WebResponse.WebResponse ( )
protected

Initializes a new instance of the T:System.Net.WebResponse class.

Definition at line 119 of file WebResponse.cs.

◆ WebResponse() [2/2]

System.Net.WebResponse.WebResponse ( SerializationInfo  serializationInfo,
StreamingContext  streamingContext 
)
protected

Initializes a new instance of the T:System.Net.WebResponse class from the specified instances of the T:System.Runtime.Serialization.SerializationInfo and T:System.Runtime.Serialization.StreamingContext classes.

Parameters
serializationInfoAn instance of the T:System.Runtime.Serialization.SerializationInfo class that contains the information required to serialize the new T:System.Net.WebRequest instance.
streamingContextAn instance of the T:System.Runtime.Serialization.StreamingContext class that indicates the source of the serialized stream that is associated with the new T:System.Net.WebRequest instance.
Exceptions
T:System.NotSupportedExceptionAny attempt is made to access the constructor, when the constructor is not overridden in a descendant class.

Definition at line 127 of file WebResponse.cs.

Member Function Documentation

◆ Close()

virtual void System.Net.WebResponse.Close ( )
virtual

When overridden by a descendant class, closes the response stream.

Exceptions
T:System.NotSupportedExceptionAny attempt is made to access the method, when the method is not overridden in a descendant class.

Reimplemented in System.Net.HttpWebResponse, System.Net.FtpWebResponse, and System.Net.FileWebResponse.

Definition at line 150 of file WebResponse.cs.

◆ Dispose() [1/2]

void System.Net.WebResponse.Dispose ( )

Releases the unmanaged resources used by the T:System.Net.WebResponse object.

Implements System.IDisposable.

Definition at line 156 of file WebResponse.cs.

◆ Dispose() [2/2]

virtual void System.Net.WebResponse.Dispose ( bool  disposing)
protectedvirtual

Releases the unmanaged resources used by the T:System.Net.WebResponse object, and optionally disposes of the managed resources.

Parameters
disposingtrue to release both managed and unmanaged resources; false to releases only unmanaged resources.

Reimplemented in System.Net.HttpWebResponse.

Definition at line 166 of file WebResponse.cs.

◆ GetObjectData()

virtual void System.Net.WebResponse.GetObjectData ( SerializationInfo  serializationInfo,
StreamingContext  streamingContext 
)
protectedvirtual

Populates a T:System.Runtime.Serialization.SerializationInfo with the data that is needed to serialize the target object.

Parameters
serializationInfoThe T:System.Runtime.Serialization.SerializationInfo to populate with data.
streamingContextA T:System.Runtime.Serialization.StreamingContext that specifies the destination for this serialization.

Implements System.Runtime.Serialization.ISerializable.

Reimplemented in System.Net.HttpWebResponse, and System.Net.FileWebResponse.

Definition at line 144 of file WebResponse.cs.

◆ GetResponseStream()

virtual Stream System.Net.WebResponse.GetResponseStream ( )
virtual

When overridden in a descendant class, returns the data stream from the Internet resource.

Returns
An instance of the T:System.IO.Stream class for reading data from the Internet resource.
Exceptions
T:System.NotSupportedExceptionAny attempt is made to access the method, when the method is not overridden in a descendant class.

Reimplemented in System.Net.HttpWebResponse, System.Net.FtpWebResponse, and System.Net.FileWebResponse.

Definition at line 184 of file WebResponse.cs.

Member Data Documentation

◆ IsFromCache

virtual bool System.Net.WebResponse.IsFromCache => m_IsFromCache

Gets a T:System.Boolean value that indicates whether this response was obtained from the cache.

Returns
true if the response was taken from the cache; otherwise, false.

Definition at line 19 of file WebResponse.cs.

◆ IsMutuallyAuthenticated

virtual bool System.Net.WebResponse.IsMutuallyAuthenticated => false

Gets a T:System.Boolean value that indicates whether mutual authentication occurred.

Returns
true if both client and server were authenticated; otherwise, false.

Definition at line 42 of file WebResponse.cs.

Property Documentation

◆ ContentLength

virtual long System.Net.WebResponse.ContentLength
getset

When overridden in a descendant class, gets or sets the content length of data being received.

Returns
The number of bytes returned from the Internet resource.
Exceptions
T:System.NotSupportedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 49 of file WebResponse.cs.

◆ ContentType

virtual string System.Net.WebResponse.ContentType
getset

When overridden in a derived class, gets or sets the content type of the data being received.

Returns
A string that contains the content type of the response.
Exceptions
T:System.NotSupportedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 66 of file WebResponse.cs.

◆ Headers

virtual WebHeaderCollection System.Net.WebResponse.Headers
get

When overridden in a derived class, gets a collection of header name-value pairs associated with this request.

Returns
An instance of the T:System.Net.WebHeaderCollection class that contains header values associated with this response.
Exceptions
T:System.NotSupportedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 96 of file WebResponse.cs.

◆ ResponseUri

virtual Uri System.Net.WebResponse.ResponseUri
get

When overridden in a derived class, gets the URI of the Internet resource that actually responded to the request.

Returns
An instance of the T:System.Uri class that contains the URI of the Internet resource that actually responded to the request.
Exceptions
T:System.NotSupportedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 83 of file WebResponse.cs.

◆ SupportsHeaders

virtual bool System.Net.WebResponse.SupportsHeaders
get

Gets a value that indicates if headers are supported.

Returns
Returns T:System.Boolean. true if headers are supported; otherwise, false.

Definition at line 109 of file WebResponse.cs.


The documentation for this class was generated from the following file: