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

Makes a request to a Uniform Resource Identifier (URI). This is an abstract class. More...

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

Public Member Functions

virtual Stream GetRequestStream ()
 When overridden in a descendant class, returns a T:System.IO.Stream for writing data to the Internet resource. More...
 
virtual WebResponse GetResponse ()
 When overridden in a descendant class, returns a response to an Internet request. More...
 
virtual IAsyncResult BeginGetResponse (AsyncCallback callback, object state)
 When overridden in a descendant class, begins an asynchronous request for an Internet resource. More...
 
virtual WebResponse EndGetResponse (IAsyncResult asyncResult)
 When overridden in a descendant class, returns a T:System.Net.WebResponse. More...
 
virtual IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state)
 When overridden in a descendant class, provides an asynchronous version of the M:System.Net.WebRequest.GetRequestStream method. More...
 
virtual Stream EndGetRequestStream (IAsyncResult asyncResult)
 When overridden in a descendant class, returns a T:System.IO.Stream for writing data to the Internet resource. More...
 
virtual Task< StreamGetRequestStreamAsync ()
 When overridden in a descendant class, returns a T:System.IO.Stream for writing data to the Internet resource as an asynchronous operation. More...
 
virtual Task< WebResponseGetResponseAsync ()
 When overridden in a descendant class, returns a response to an Internet request as an asynchronous operation. More...
 
virtual void Abort ()
 Aborts the Request 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...
 

Static Public Member Functions

static void RegisterPortableWebRequestCreator (IWebRequestCreate creator)
 Register an T:System.Net.IWebRequestCreate object. More...
 
static WebRequest Create (string requestUriString)
 Initializes a new T:System.Net.WebRequest instance for the specified URI scheme. More...
 
static WebRequest Create (Uri requestUri)
 Initializes a new T:System.Net.WebRequest instance for the specified URI scheme. More...
 
static WebRequest CreateDefault (Uri requestUri)
 Initializes a new T:System.Net.WebRequest instance for the specified URI scheme. More...
 
static HttpWebRequest CreateHttp (string requestUriString)
 Initializes a new T:System.Net.HttpWebRequest instance for the specified URI string. More...
 
static HttpWebRequest CreateHttp (Uri requestUri)
 Initializes a new T:System.Net.HttpWebRequest instance for the specified URI. More...
 
static bool RegisterPrefix (string prefix, IWebRequestCreate creator)
 Registers a T:System.Net.WebRequest descendant for the specified URI. More...
 
static IWebProxy GetSystemWebProxy ()
 Returns a proxy configured with the Internet Explorer settings of the currently impersonated user. More...
 

Protected Member Functions

 WebRequest ()
 Initializes a new instance of the T:System.Net.WebRequest class. More...
 
 WebRequest (SerializationInfo serializationInfo, StreamingContext streamingContext)
 Initializes a new instance of the T:System.Net.WebRequest 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 needed to serialize the target object. 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 IWebRequestCreate CreatorInstance [get]
 When overridden in a descendant class, gets the factory object derived from the T:System.Net.IWebRequestCreate class used to create the T:System.Net.WebRequest instantiated for making the request to the specified URI. More...
 
static RequestCachePolicy DefaultCachePolicy [get, set]
 Gets or sets the default cache policy for this request. More...
 
virtual RequestCachePolicy CachePolicy [get, set]
 Gets or sets the cache policy for this request. More...
 
virtual string Method [get, set]
 When overridden in a descendant class, gets or sets the protocol method to use in this request. More...
 
virtual Uri RequestUri [get]
 When overridden in a descendant class, gets the URI of the Internet resource associated with the request. More...
 
virtual string ConnectionGroupName [get, set]
 When overridden in a descendant class, gets or sets the name of the connection group for the request. More...
 
virtual WebHeaderCollection Headers [get, set]
 When overridden in a descendant class, gets or sets the collection of header name/value pairs associated with the request. More...
 
virtual long ContentLength [get, set]
 When overridden in a descendant class, gets or sets the content length of the request data being sent. More...
 
virtual string ContentType [get, set]
 When overridden in a descendant class, gets or sets the content type of the request data being sent. More...
 
virtual ICredentials Credentials [get, set]
 When overridden in a descendant class, gets or sets the network credentials used for authenticating the request with the Internet resource. More...
 
virtual bool UseDefaultCredentials [get, set]
 When overridden in a descendant class, gets or sets a T:System.Boolean value that controls whether P:System.Net.CredentialCache.DefaultCredentials are sent with requests. More...
 
virtual IWebProxy Proxy [get, set]
 When overridden in a descendant class, gets or sets the network proxy to use to access this Internet resource. More...
 
virtual bool PreAuthenticate [get, set]
 When overridden in a descendant class, indicates whether to pre-authenticate the request. More...
 
virtual int Timeout [get, set]
 Gets or sets the length of time, in milliseconds, before the request times out. More...
 
AuthenticationLevel AuthenticationLevel [get, set]
 Gets or sets values indicating the level of authentication and impersonation used for this request. More...
 
TokenImpersonationLevel ImpersonationLevel [get, set]
 Gets or sets the impersonation level for the current request. More...
 
static IWebProxy DefaultWebProxy [get, set]
 Gets or sets the global HTTP proxy. More...
 

Detailed Description

Makes a request to a Uniform Resource Identifier (URI). This is an abstract class.

Definition at line 21 of file WebRequest.cs.

Constructor & Destructor Documentation

◆ WebRequest() [1/2]

System.Net.WebRequest.WebRequest ( )
protected

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

Definition at line 673 of file WebRequest.cs.

◆ WebRequest() [2/2]

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

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

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

Definition at line 683 of file WebRequest.cs.

Member Function Documentation

◆ Abort()

virtual void System.Net.WebRequest.Abort ( )
virtual

Aborts the Request

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

Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.

Definition at line 854 of file WebRequest.cs.

◆ BeginGetRequestStream()

virtual IAsyncResult System.Net.WebRequest.BeginGetRequestStream ( AsyncCallback  callback,
object  state 
)
virtual

When overridden in a descendant class, provides an asynchronous version of the M:System.Net.WebRequest.GetRequestStream method.

Parameters
callbackThe T:System.AsyncCallback delegate.
stateAn object containing state information for this asynchronous request.
Returns
An T:System.IAsyncResult that references the asynchronous request.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to access the method, when the method is not overridden in a descendant class.

Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.

Definition at line 759 of file WebRequest.cs.

◆ BeginGetResponse()

virtual IAsyncResult System.Net.WebRequest.BeginGetResponse ( AsyncCallback  callback,
object  state 
)
virtual

When overridden in a descendant class, begins an asynchronous request for an Internet resource.

Parameters
callbackThe T:System.AsyncCallback delegate.
stateAn object containing state information for this asynchronous request.
Returns
An T:System.IAsyncResult that references the asynchronous request.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to access the method, when the method is not overridden in a descendant class.

Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.

Definition at line 737 of file WebRequest.cs.

◆ Create() [1/2]

static WebRequest System.Net.WebRequest.Create ( string  requestUriString)
static

Initializes a new T:System.Net.WebRequest instance for the specified URI scheme.

Parameters
requestUriStringThe URI that identifies the Internet resource.
Returns
A T:System.Net.WebRequest descendant for the specific URI scheme.
Exceptions
T:System.NotSupportedExceptionThe request scheme specified in requestUriString has not been registered.
T:System.ArgumentNullExceptionrequestUriString is null.
T:System.Security.SecurityExceptionThe caller does not have permission to connect to the requested URI or a URI that the request is redirected to.
T:System.UriFormatExceptionIn the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, T:System.FormatException, instead.The URI specified in requestUriString is not a valid URI.

Definition at line 533 of file WebRequest.cs.

◆ Create() [2/2]

static WebRequest System.Net.WebRequest.Create ( Uri  requestUri)
static

Initializes a new T:System.Net.WebRequest instance for the specified URI scheme.

Parameters
requestUriA T:System.Uri containing the URI of the requested resource.
Returns
A T:System.Net.WebRequest descendant for the specified URI scheme.
Exceptions
T:System.NotSupportedExceptionThe request scheme specified in requestUri is not registered.
T:System.ArgumentNullExceptionrequestUri is null.
T:System.Security.SecurityExceptionThe caller does not have permission to connect to the requested URI or a URI that the request is redirected to.

Definition at line 550 of file WebRequest.cs.

◆ CreateDefault()

static WebRequest System.Net.WebRequest.CreateDefault ( Uri  requestUri)
static

Initializes a new T:System.Net.WebRequest instance for the specified URI scheme.

Parameters
requestUriA T:System.Uri containing the URI of the requested resource.
Returns
A T:System.Net.WebRequest descendant for the specified URI scheme.
Exceptions
T:System.NotSupportedExceptionThe request scheme specified in requestUri is not registered.
T:System.ArgumentNullExceptionrequestUri is null.
T:System.Security.SecurityExceptionThe caller does not have permission to connect to the requested URI or a URI that the request is redirected to.

Definition at line 566 of file WebRequest.cs.

◆ CreateHttp() [1/2]

static HttpWebRequest System.Net.WebRequest.CreateHttp ( string  requestUriString)
static

Initializes a new T:System.Net.HttpWebRequest instance for the specified URI string.

Parameters
requestUriStringA URI string that identifies the Internet resource.
Returns
Returns T:System.Net.HttpWebRequest.An T:System.Net.HttpWebRequest instance for the specific URI string.
Exceptions
T:System.NotSupportedExceptionThe request scheme specified in requestUriString is the http or https scheme.
T:System.ArgumentNullExceptionrequestUriString is null.
T:System.Security.SecurityExceptionThe caller does not have permission to connect to the requested URI or a URI that the request is redirected to.
T:System.UriFormatExceptionThe URI specified in requestUriString is not a valid URI.

Definition at line 584 of file WebRequest.cs.

◆ CreateHttp() [2/2]

static HttpWebRequest System.Net.WebRequest.CreateHttp ( Uri  requestUri)
static

Initializes a new T:System.Net.HttpWebRequest instance for the specified URI.

Parameters
requestUriA URI that identifies the Internet resource.
Returns
Returns T:System.Net.HttpWebRequest.An T:System.Net.HttpWebRequest instance for the specific URI string.
Exceptions
T:System.NotSupportedExceptionThe request scheme specified in requestUri is the http or https scheme.
T:System.ArgumentNullExceptionrequestUri is null.
T:System.Security.SecurityExceptionThe caller does not have permission to connect to the requested URI or a URI that the request is redirected to.
T:System.UriFormatExceptionThe URI specified in requestUri is not a valid URI.

Definition at line 602 of file WebRequest.cs.

◆ EndGetRequestStream()

virtual Stream System.Net.WebRequest.EndGetRequestStream ( IAsyncResult  asyncResult)
virtual

When overridden in a descendant class, returns a T:System.IO.Stream for writing data to the Internet resource.

Parameters
asyncResultAn T:System.IAsyncResult that references a pending request for a stream.
Returns
A T:System.IO.Stream to write data to.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to access the method, when the method is not overridden in a descendant class.

Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.

Definition at line 769 of file WebRequest.cs.

◆ EndGetResponse()

virtual WebResponse System.Net.WebRequest.EndGetResponse ( IAsyncResult  asyncResult)
virtual

When overridden in a descendant class, returns a T:System.Net.WebResponse.

Parameters
asyncResultAn T:System.IAsyncResult that references a pending request for a response.
Returns
A T:System.Net.WebResponse that contains a response to the Internet request.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to access the method, when the method is not overridden in a descendant class.

Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.

Definition at line 747 of file WebRequest.cs.

◆ GetObjectData()

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

Populates a T:System.Runtime.Serialization.SerializationInfo with the data 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.HttpWebRequest, and System.Net.FileWebRequest.

Definition at line 701 of file WebRequest.cs.

◆ GetRequestStream()

virtual Stream System.Net.WebRequest.GetRequestStream ( )
virtual

When overridden in a descendant class, returns a T:System.IO.Stream for writing data to the Internet resource.

Returns
A T:System.IO.Stream for writing data to the Internet resource.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to access the method, when the method is not overridden in a descendant class.

Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.

Definition at line 717 of file WebRequest.cs.

◆ GetRequestStreamAsync()

virtual Task<Stream> System.Net.WebRequest.GetRequestStreamAsync ( )
virtual

When overridden in a descendant class, returns a T:System.IO.Stream for writing data to the Internet resource as an asynchronous operation.

Returns
Returns T:System.Threading.Tasks.Task`1.The task object representing the asynchronous operation.

Definition at line 778 of file WebRequest.cs.

◆ GetResponse()

virtual WebResponse System.Net.WebRequest.GetResponse ( )
virtual

When overridden in a descendant class, returns a response to an Internet request.

Returns
A T:System.Net.WebResponse containing the response to the Internet request.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to access the method, when the method is not overridden in a descendant class.

Reimplemented in System.Net.HttpWebRequest, System.Net.FtpWebRequest, and System.Net.FileWebRequest.

Definition at line 725 of file WebRequest.cs.

◆ GetResponseAsync()

virtual Task<WebResponse> System.Net.WebRequest.GetResponseAsync ( )
virtual

When overridden in a descendant class, returns a response to an Internet request as an asynchronous operation.

Returns
Returns T:System.Threading.Tasks.Task`1.The task object representing the asynchronous operation.

Definition at line 813 of file WebRequest.cs.

◆ GetSystemWebProxy()

static IWebProxy System.Net.WebRequest.GetSystemWebProxy ( )
static

Returns a proxy configured with the Internet Explorer settings of the currently impersonated user.

Returns
An T:System.Net.IWebProxy used by every call to instances of T:System.Net.WebRequest.

Definition at line 881 of file WebRequest.cs.

◆ RegisterPortableWebRequestCreator()

static void System.Net.WebRequest.RegisterPortableWebRequestCreator ( IWebRequestCreate  creator)
static

Register an T:System.Net.IWebRequestCreate object.

Parameters
creatorThe T:System.Net.IWebRequestCreate object to register.

Definition at line 482 of file WebRequest.cs.

◆ RegisterPrefix()

static bool System.Net.WebRequest.RegisterPrefix ( string  prefix,
IWebRequestCreate  creator 
)
static

Registers a T:System.Net.WebRequest descendant for the specified URI.

Parameters
prefixThe complete URI or URI prefix that the T:System.Net.WebRequest descendant services.
creatorThe create method that the T:System.Net.WebRequest calls to create the T:System.Net.WebRequest descendant.
Returns
true if registration is successful; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionprefix is null-or- creator is null.

Definition at line 624 of file WebRequest.cs.

Property Documentation

◆ AuthenticationLevel

AuthenticationLevel System.Net.WebRequest.AuthenticationLevel
getset

Gets or sets values indicating the level of authentication and impersonation used for this request.

Returns
A bitwise combination of the T:System.Net.Security.AuthenticationLevel values. The default value is F:System.Net.Security.AuthenticationLevel.MutualAuthRequested.In mutual authentication, both the client and server present credentials to establish their identity. The F:System.Net.Security.AuthenticationLevel.MutualAuthRequired and F:System.Net.Security.AuthenticationLevel.MutualAuthRequested values are relevant for Kerberos authentication. Kerberos authentication can be supported directly, or can be used if the Negotiate security protocol is used to select the actual security protocol. For more information about authentication protocols, see Internet Authentication.To determine whether mutual authentication occurred, check the P:System.Net.WebResponse.IsMutuallyAuthenticated property. If you specify the F:System.Net.Security.AuthenticationLevel.MutualAuthRequired authentication flag value and mutual authentication does not occur, your application will receive an T:System.IO.IOException with a T:System.Net.ProtocolViolationException inner exception indicating that mutual authentication failed.

Definition at line 396 of file WebRequest.cs.

◆ CachePolicy

virtual RequestCachePolicy System.Net.WebRequest.CachePolicy
getset

Gets or sets the cache policy for this request.

Returns
A T:System.Net.Cache.RequestCachePolicy object that defines a cache policy.

Definition at line 186 of file WebRequest.cs.

◆ ConnectionGroupName

virtual string System.Net.WebRequest.ConnectionGroupName
getset

When overridden in a descendant class, gets or sets the name of the connection group for the request.

Returns
The name of the connection group for the request.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 232 of file WebRequest.cs.

◆ ContentLength

virtual long System.Net.WebRequest.ContentLength
getset

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

Returns
The number of bytes of request data being sent.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 265 of file WebRequest.cs.

◆ ContentType

virtual string System.Net.WebRequest.ContentType
getset

When overridden in a descendant class, gets or sets the content type of the request data being sent.

Returns
The content type of the request data.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 281 of file WebRequest.cs.

◆ CreatorInstance

virtual IWebRequestCreate System.Net.WebRequest.CreatorInstance
get

When overridden in a descendant class, gets the factory object derived from the T:System.Net.IWebRequestCreate class used to create the T:System.Net.WebRequest instantiated for making the request to the specified URI.

Returns
Returns T:System.Net.IWebRequestCreate.The derived T:System.Net.WebRequest type returned by the M:System.Net.IWebRequestCreate.Create(System.Uri) method.

Definition at line 123 of file WebRequest.cs.

◆ Credentials

virtual ICredentials System.Net.WebRequest.Credentials
getset

When overridden in a descendant class, gets or sets the network credentials used for authenticating the request with the Internet resource.

Returns
An T:System.Net.ICredentials containing the authentication credentials associated with the request. The default is null.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 299 of file WebRequest.cs.

◆ DefaultCachePolicy

RequestCachePolicy System.Net.WebRequest.DefaultCachePolicy
staticgetset

Gets or sets the default cache policy for this request.

Returns
A T:System.Net.Cache.HttpRequestCachePolicy that specifies the cache policy in effect for this request when no other policy is applicable.

Definition at line 170 of file WebRequest.cs.

◆ DefaultWebProxy

IWebProxy System.Net.WebRequest.DefaultWebProxy
staticgetset

Gets or sets the global HTTP proxy.

Returns
An T:System.Net.IWebProxy used by every call to instances of T:System.Net.WebRequest.

Definition at line 463 of file WebRequest.cs.

◆ Headers

virtual WebHeaderCollection System.Net.WebRequest.Headers
getset

When overridden in a descendant class, gets or sets the collection of header name/value pairs associated with the request.

Returns
A T:System.Net.WebHeaderCollection containing the header name/value pairs associated with this request.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 248 of file WebRequest.cs.

◆ ImpersonationLevel

TokenImpersonationLevel System.Net.WebRequest.ImpersonationLevel
getset

Gets or sets the impersonation level for the current request.

Returns
A T:System.Security.Principal.TokenImpersonationLevel value.

Definition at line 410 of file WebRequest.cs.

◆ Method

virtual string System.Net.WebRequest.Method
getset

When overridden in a descendant class, gets or sets the protocol method to use in this request.

Returns
The protocol method to use in this request.
Exceptions
T:System.NotImplementedExceptionIf the property is not overridden in a descendant class, any attempt is made to get or set the property.

Definition at line 202 of file WebRequest.cs.

◆ PreAuthenticate

virtual bool System.Net.WebRequest.PreAuthenticate
getset

When overridden in a descendant class, indicates whether to pre-authenticate the request.

Returns
true to pre-authenticate; otherwise, false.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 355 of file WebRequest.cs.

◆ Proxy

virtual IWebProxy System.Net.WebRequest.Proxy
getset

When overridden in a descendant class, gets or sets the network proxy to use to access this Internet resource.

Returns
The T:System.Net.IWebProxy to use to access the Internet resource.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 337 of file WebRequest.cs.

◆ RequestUri

virtual Uri System.Net.WebRequest.RequestUri
get

When overridden in a descendant class, gets the URI of the Internet resource associated with the request.

Returns
A T:System.Uri representing the resource associated with the request
Exceptions
T:System.NotImplementedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 220 of file WebRequest.cs.

◆ Timeout

virtual int System.Net.WebRequest.Timeout
getset

Gets or sets the length of time, in milliseconds, before the request times out.

Returns
The length of time, in milliseconds, until the request times out, or the value F:System.Threading.Timeout.Infinite to indicate that the request does not time out. The default value is defined by the descendant class.
Exceptions
T:System.NotImplementedExceptionAny attempt is made to get or set the property, when the property is not overridden in a descendant class.

Definition at line 370 of file WebRequest.cs.

◆ UseDefaultCredentials

virtual bool System.Net.WebRequest.UseDefaultCredentials
getset

When overridden in a descendant class, gets or sets a T:System.Boolean value that controls whether P:System.Net.CredentialCache.DefaultCredentials are sent with requests.

Returns
true if the default credentials are used; otherwise false. The default value is false.
Exceptions
T:System.InvalidOperationExceptionYou attempted to set this property after the request was sent.
T:System.NotImplementedExceptionAny attempt is made to access the property, when the property is not overridden in a descendant class.

Definition at line 319 of file WebRequest.cs.


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