Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
2350 lines (2109 sloc) 156 KB
<Type Name="WebRequest" FullName="System.Net.WebRequest">
<TypeSignature Language="C#" Value="public abstract class WebRequest : MarshalByRefObject, System.Runtime.Serialization.ISerializable" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi abstract serializable beforefieldinit WebRequest extends System.MarshalByRefObject implements class System.Runtime.Serialization.ISerializable" />
<TypeSignature Language="DocId" Value="T:System.Net.WebRequest" />
<TypeSignature Language="VB.NET" Value="Public MustInherit Class WebRequest&#xA;Inherits MarshalByRefObject&#xA;Implements ISerializable" />
<TypeSignature Language="C++ CLI" Value="public ref class WebRequest abstract : MarshalByRefObject, System::Runtime::Serialization::ISerializable" />
<TypeSignature Language="F#" Value="type WebRequest = class&#xA; inherit MarshalByRefObject&#xA; interface ISerializable" />
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
<BaseTypeName FrameworkAlternate="netframework-4.5">System.MarshalByRefObject</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName>
</Interface>
</Interfaces>
<Attributes>
<Attribute FrameworkAlternate="netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.Serializable</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Makes a request to a Uniform Resource Identifier (URI). This is an <see langword="abstract" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
> [!IMPORTANT]
> We don't recommend that you use `WebRequest` or its derived classes for new development. Instead, use the <xref:System.Net.Http.HttpClient?displayProperty=nameWithType> class.
<xref:System.Net.WebRequest> is the `abstract` base class for .NET's request/response model for accessing data from the Internet. An application that uses the request/response model can request data from the Internet in a protocol-agnostic manner, in which the application works with instances of the <xref:System.Net.WebRequest> class while protocol-specific descendant classes carry out the details of the request.
Requests are sent from an application to a particular URI, such as a Web page on a server. The URI determines the proper descendant class to create from a list of <xref:System.Net.WebRequest> descendants registered for the application. <xref:System.Net.WebRequest> descendants are typically registered to handle a specific protocol, such as HTTP or FTP, but can be registered to handle a request to a specific server or path on a server.
The <xref:System.Net.WebRequest> class throws a <xref:System.Net.WebException> when errors occur while accessing an Internet resource. The <xref:System.Net.WebException.Status%2A> property is one of the <xref:System.Net.WebExceptionStatus> values that indicates the source of the error. When <xref:System.Net.WebException.Status%2A> is <xref:System.Net.WebExceptionStatus.ProtocolError?displayProperty=nameWithType>, the <xref:System.Net.WebException.Response%2A> property contains the <xref:System.Net.WebResponse> received from the Internet resource.
Because the <xref:System.Net.WebRequest> class is an `abstract` class, the actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by <xref:System.Net.WebRequest.Create%2A> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
> [!NOTE]
> Use the <xref:System.Net.WebRequest.Create%2A> method to initialize new <xref:System.Net.WebRequest> instances. Do not use the <xref:System.Net.WebRequest> constructor.
> [!NOTE]
> If the application that creates the WebRequest object runs with the credentials of a Normal user, the application will not be able to access certificates installed in the local machine store unless permission has been explicitly given to the user to do so.
## Examples
The following example shows how to create a <xref:System.Net.WebRequest> instance and return the response.
[!code-cpp[NclWebRequestSimple#1](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLWebRequestSimple/CPP/webrequestget.cpp#1)]
[!code-csharp[NclWebRequestSimple#1](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLWebRequestSimple/CS/webrequestget.cs#1)]
[!code-vb[NclWebRequestSimple#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLWebRequestSimple/VB/webrequestget.vb#1)]
]]></format>
</remarks>
<permission cref="T:System.Net.WebPermission">To access the requested URI or any URI that the request is redirected to. Associated enumeration: <see cref="F:System.Net.NetworkAccess.Connect" />.</permission>
<block subset="none" type="overrides">
<para>When you inherit from <see cref="T:System.Net.WebRequest" />, you must override the following members: <see cref="P:System.Net.WebRequest.Method" />, <see cref="P:System.Net.WebRequest.RequestUri" />, <see cref="P:System.Net.WebRequest.Headers" />, <see cref="P:System.Net.WebRequest.ContentLength" />, <see cref="P:System.Net.WebRequest.ContentType" />, <see cref="P:System.Net.WebRequest.Credentials" />, <see cref="P:System.Net.WebRequest.PreAuthenticate" />, <see cref="M:System.Net.WebRequest.GetRequestStream" />, <see cref="M:System.Net.WebRequest.BeginGetRequestStream(System.AsyncCallback,System.Object)" />, <see cref="M:System.Net.WebRequest.EndGetRequestStream(System.IAsyncResult)" />, <see cref="M:System.Net.WebRequest.GetResponse" />, <see cref="M:System.Net.WebRequest.BeginGetResponse(System.AsyncCallback,System.Object)" />, and <see cref="M:System.Net.WebRequest.EndGetResponse(System.IAsyncResult)" />. In addition, you must provide an implementation of the <see cref="T:System.Net.IWebRequestCreate" /> interface, which defines the <see cref="M:System.Net.IWebRequestCreate.Create(System.Uri)" /> method used when you call <see cref="M:System.Net.WebRequest.Create(System.Uri)" />. You must register the class that implements the <see cref="T:System.Net.IWebRequestCreate" /> interface, using the <see cref="M:System.Net.WebRequest.RegisterPrefix(System.String,System.Net.IWebRequestCreate)" /> method or the configuration file.</para>
</block>
<altmember cref="T:System.Net.HttpWebRequest" />
<related type="Article" href="~/docs/framework/network-programming/requesting-data.md">Requesting Data</related>
<related type="Article" href="~/docs/framework/network-programming/programming-pluggable-protocols.md">Programming Pluggable Protocols</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Net.WebRequest" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected WebRequest ();" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.#ctor" />
<MemberSignature Language="VB.NET" Value="Protected Sub New ()" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; WebRequest();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Net.WebRequest" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Use the <xref:System.Net.WebRequest.Create%2A> method to initialize new <xref:System.Net.WebRequest> instances. Do not use the constructor.
## Examples
The following example shows how to create a <xref:System.Net.WebRequest> instance by calling the <xref:System.Net.WebRequest.Create%2A> method on the <xref:System.Net.WebRequest> class.
[!code-cpp[Classic WebRequest.WebRequest Example#1](~/samples/snippets/cpp/VS_Snippets_Remoting/Classic WebRequest.WebRequest Example/CPP/source.cpp#1)]
[!code-csharp[Classic WebRequest.WebRequest Example#1](~/samples/snippets/csharp/VS_Snippets_Remoting/Classic WebRequest.WebRequest Example/CS/source.cs#1)]
[!code-vb[Classic WebRequest.WebRequest Example#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/Classic WebRequest.WebRequest Example/VB/source.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected WebRequest (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig specialname rtspecialname instance void .ctor(class System.Runtime.Serialization.SerializationInfo serializationInfo, valuetype System.Runtime.Serialization.StreamingContext streamingContext) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; WebRequest(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);" />
<MemberSignature Language="F#" Value="new System.Net.WebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -&gt; System.Net.WebRequest" Usage="new System.Net.WebRequest (serializationInfo, streamingContext)" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="serializationInfo" Type="System.Runtime.Serialization.SerializationInfo" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="streamingContext" Type="System.Runtime.Serialization.StreamingContext" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="serializationInfo">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that contains the information required to serialize the new <see cref="T:System.Net.WebRequest" /> instance.</param>
<param name="streamingContext">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> that indicates the source of the serialized stream associated with the new <see cref="T:System.Net.WebRequest" /> instance.</param>
<summary>Initializes a new instance of the <see cref="T:System.Net.WebRequest" /> class from the specified instances of the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> and <see cref="T:System.Runtime.Serialization.StreamingContext" /> classes.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When implemented by a descendant class, this constructor implements the <xref:System.Runtime.Serialization.ISerializable> interface for the <xref:System.Net.WebRequest> descendant.
Notice that an application must run in full trust mode when using serialization.
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to access the constructor, when the constructor is not overridden in a descendant class.</exception>
<related type="Article" href="~/docs/standard/serialization/xml-and-soap-serialization.md">XML and SOAP Serialization</related>
</Docs>
</Member>
<Member MemberName="Abort">
<MemberSignature Language="C#" Value="public virtual void Abort ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance void Abort() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.Abort" />
<MemberSignature Language="VB.NET" Value="Public Overridable Sub Abort ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual void Abort();" />
<MemberSignature Language="F#" Value="abstract member Abort : unit -&gt; unit&#xA;override this.Abort : unit -&gt; unit" Usage="webRequest.Abort " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Aborts the request.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.Abort%2A> method cancels asynchronous requests to Internet resources started with the <xref:System.Net.WebRequest.BeginGetResponse%2A> method.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class.</exception>
</Docs>
</Member>
<Member MemberName="AuthenticationLevel">
<MemberSignature Language="C#" Value="public System.Net.Security.AuthenticationLevel AuthenticationLevel { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Net.Security.AuthenticationLevel AuthenticationLevel" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.AuthenticationLevel" />
<MemberSignature Language="VB.NET" Value="Public Property AuthenticationLevel As AuthenticationLevel" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Net::Security::AuthenticationLevel AuthenticationLevel { System::Net::Security::AuthenticationLevel get(); void set(System::Net::Security::AuthenticationLevel value); };" />
<MemberSignature Language="F#" Value="member this.AuthenticationLevel : System.Net.Security.AuthenticationLevel with get, set" Usage="System.Net.WebRequest.AuthenticationLevel" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Net.Security.AuthenticationLevel</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets values indicating the level of authentication and impersonation used for this request.</summary>
<value>A bitwise combination of the <see cref="T:System.Net.Security.AuthenticationLevel" /> values. The default value is <see cref="F:System.Net.Security.AuthenticationLevel.MutualAuthRequested" />.
In mutual authentication, both the client and server present credentials to establish their identity. The <see cref="F:System.Net.Security.AuthenticationLevel.MutualAuthRequired" /> and <see cref="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](https://msdn.microsoft.com/library/d342e87c-f672-4660-a513-41a2f2b80c4a).
To determine whether mutual authentication occurred, check the <see cref="P:System.Net.WebResponse.IsMutuallyAuthenticated" /> property.
If you specify the <see cref="F:System.Net.Security.AuthenticationLevel.MutualAuthRequired" /> authentication flag value and mutual authentication does not occur, your application will receive an <see cref="T:System.IO.IOException" /> with a <see cref="T:System.Net.ProtocolViolationException" /> inner exception indicating that mutual authentication failed.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example sets the value of this property.
[!code-cpp[NclCredPolicy#1](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLCredPolicy/CPP/NCLCredPolicy.cpp#1)]
[!code-csharp[NclCredPolicy#1](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLCredPolicy/CS/websample.cs#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="BeginGetRequestStream">
<MemberSignature Language="C#" Value="public virtual IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.IAsyncResult BeginGetRequestStream(class System.AsyncCallback callback, object state) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.BeginGetRequestStream(System.AsyncCallback,System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function BeginGetRequestStream (callback As AsyncCallback, state As Object) As IAsyncResult" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual IAsyncResult ^ BeginGetRequestStream(AsyncCallback ^ callback, System::Object ^ state);" />
<MemberSignature Language="F#" Value="abstract member BeginGetRequestStream : AsyncCallback * obj -&gt; IAsyncResult&#xA;override this.BeginGetRequestStream : AsyncCallback * obj -&gt; IAsyncResult" Usage="webRequest.BeginGetRequestStream (callback, state)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="callback" Type="System.AsyncCallback" Index="0" FrameworkAlternate="xamarinmac-3.0" />
<Parameter Name="state" Type="System.Object" Index="1" FrameworkAlternate="xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="callback">The <see cref="T:System.AsyncCallback" /> delegate.</param>
<param name="state">An object containing state information for this asynchronous request.</param>
<summary>When overridden in a descendant class, provides an asynchronous version of the <see cref="M:System.Net.WebRequest.GetRequestStream" /> method.</summary>
<returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous request.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.BeginGetRequestStream%2A> method starts an asynchronous request for a stream used to send data to an Internet resource. The callback method that implements the <xref:System.AsyncCallback> delegate uses the <xref:System.Net.WebRequest.EndGetRequestStream%2A> method to return the request stream.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example uses the <xref:System.Net.WebRequest.BeginGetRequestStream%2A> to asynchronously obtain the request stream.
[!code-cpp[WebRequest_BeginGetRequest#3](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_BeginGetRequest/CPP/webrequest_begingetrequest.cpp#3)]
[!code-csharp[WebRequest_BeginGetRequest#3](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_BeginGetRequest/CS/webrequest_begingetrequest.cs#3)]
[!code-vb[WebRequest_BeginGetRequest#3](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_BeginGetRequest/VB/webrequest_begingetrequest.vb#3)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class.</exception>
<altmember cref="M:System.Net.WebRequest.EndGetRequestStream(System.IAsyncResult)" />
<related type="Article" href="~/docs/framework/network-programming/making-asynchronous-requests.md">Making Asynchronous Requests</related>
</Docs>
</Member>
<Member MemberName="BeginGetResponse">
<MemberSignature Language="C#" Value="public virtual IAsyncResult BeginGetResponse (AsyncCallback callback, object state);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.IAsyncResult BeginGetResponse(class System.AsyncCallback callback, object state) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.BeginGetResponse(System.AsyncCallback,System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function BeginGetResponse (callback As AsyncCallback, state As Object) As IAsyncResult" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual IAsyncResult ^ BeginGetResponse(AsyncCallback ^ callback, System::Object ^ state);" />
<MemberSignature Language="F#" Value="abstract member BeginGetResponse : AsyncCallback * obj -&gt; IAsyncResult&#xA;override this.BeginGetResponse : AsyncCallback * obj -&gt; IAsyncResult" Usage="webRequest.BeginGetResponse (callback, state)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="callback" Type="System.AsyncCallback" Index="0" FrameworkAlternate="xamarinmac-3.0" />
<Parameter Name="state" Type="System.Object" Index="1" FrameworkAlternate="xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="callback">The <see cref="T:System.AsyncCallback" /> delegate.</param>
<param name="state">An object containing state information for this asynchronous request.</param>
<summary>When overridden in a descendant class, begins an asynchronous request for an Internet resource.</summary>
<returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous request.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.BeginGetResponse%2A> method starts an asynchronous request for a response. The callback method that implements the <xref:System.AsyncCallback> delegate uses the <xref:System.Net.WebRequest.EndGetResponse%2A> method to return the <xref:System.Net.WebResponse> from the Internet resource.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
> [!NOTE]
> If a WebException is thrown, use the <xref:System.Net.WebException.Response%2A> and <xref:System.Net.WebException.Status%2A> properties of the exception to determine the response from the server.
## Examples
The following example uses <xref:System.Net.WebRequest.BeginGetResponse%2A> to asynchronously request the target resource. When the resource has been obtained, the specified callback method will be executed.
[!code-cpp[WebRequest_BeginGetResponse#2](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_BeginGetResponse/CPP/webrequest_begingetresponse.cpp#2)]
[!code-csharp[WebRequest_BeginGetResponse#2](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_BeginGetResponse/CS/webrequest_begingetresponse.cs#2)]
[!code-vb[WebRequest_BeginGetResponse#2](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_BeginGetResponse/VB/webrequest_begingetresponse.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class.</exception>
<altmember cref="M:System.Net.WebRequest.EndGetResponse(System.IAsyncResult)" />
<altmember cref="M:System.Net.WebRequest.GetResponse" />
<related type="Article" href="~/docs/framework/network-programming/making-asynchronous-requests.md">Making Asynchronous Requests</related>
</Docs>
</Member>
<Member MemberName="CachePolicy">
<MemberSignature Language="C#" Value="public virtual System.Net.Cache.RequestCachePolicy CachePolicy { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Net.Cache.RequestCachePolicy CachePolicy" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.CachePolicy" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property CachePolicy As RequestCachePolicy" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Net::Cache::RequestCachePolicy ^ CachePolicy { System::Net::Cache::RequestCachePolicy ^ get(); void set(System::Net::Cache::RequestCachePolicy ^ value); };" />
<MemberSignature Language="F#" Value="member this.CachePolicy : System.Net.Cache.RequestCachePolicy with get, set" Usage="System.Net.WebRequest.CachePolicy" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Net.Cache.RequestCachePolicy</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the cache policy for this request.</summary>
<value>A <see cref="T:System.Net.Cache.RequestCachePolicy" /> object that defines a cache policy.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The current cache policy and the presence of the requested resource in the cache determine whether a response can be retrieved from the cache. Using cached responses usually improves application performance, but there is a risk that the response in the cache does not match the response on the server.
Default cache policy can be specified in the Machine.config configuration file or by setting the <xref:System.Net.HttpWebRequest.DefaultCachePolicy%2A> property for requests that use the Hypertext Transfer Protocol (HTTP) or Secure Hypertext Transfer Protocol (HTTPS) URI scheme.
A copy of a resource is only added to the cache if the response stream for the resource is retrieved and read to the end of the stream. So another request for the same resource could use a cached copy, depending on the cache policy level for this request.
## Examples
The following code example demonstrates setting the cache policy for a Web request.
[!code-cpp[NCLSimpleCache#2](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLSimpleCache/CPP/NCLSimpleCache.cpp#2)]
[!code-csharp[NCLSimpleCache#2](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLSimpleCache/CS/example.cs#2)]
]]></format>
</remarks>
<altmember cref="T:System.Net.Cache.RequestCachePolicy" />
<altmember cref="T:System.Net.Cache.HttpRequestCacheLevel" />
<altmember cref="T:System.Net.Cache.RequestCacheLevel" />
<altmember cref="P:System.Net.HttpWebRequest.DefaultCachePolicy" />
<altmember cref="P:System.Net.WebRequest.DefaultCachePolicy" />
</Docs>
</Member>
<Member MemberName="ConnectionGroupName">
<MemberSignature Language="C#" Value="public virtual string ConnectionGroupName { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ConnectionGroupName" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.ConnectionGroupName" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property ConnectionGroupName As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ ConnectionGroupName { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.ConnectionGroupName : string with get, set" Usage="System.Net.WebRequest.ConnectionGroupName" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>When overridden in a descendant class, gets or sets the name of the connection group for the request.</summary>
<value>The name of the connection group for the request.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.ConnectionGroupName%2A> property associates specific requests within an application to one or more connection pools.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class.</exception>
<block subset="none" type="overrides">
<para>The <see cref="P:System.Net.WebRequest.ConnectionGroupName" /> property typically associates a group of requests that share a set of credentials with a connection to an Internet resource to avoid potential security failures.</para>
</block>
<altmember cref="P:System.Net.Configuration.ConnectionManagementElement.MaxConnection" />
<altmember cref="P:System.Net.HttpWebRequest.ConnectionGroupName" />
<related type="Article" href="~/docs/framework/network-programming/connection-grouping.md">Connection Grouping</related>
</Docs>
</Member>
<Member MemberName="ContentLength">
<MemberSignature Language="C#" Value="public virtual long ContentLength { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int64 ContentLength" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.ContentLength" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property ContentLength As Long" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property long ContentLength { long get(); void set(long value); };" />
<MemberSignature Language="F#" Value="member this.ContentLength : int64 with get, set" Usage="System.Net.WebRequest.ContentLength" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int64</ReturnType>
</ReturnValue>
<Docs>
<summary>When overridden in a descendant class, gets or sets the content length of the request data being sent.</summary>
<value>The number of bytes of request data being sent.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.ContentLength%2A> property contains the number of bytes of data sent to the Internet resource by the <xref:System.Net.WebRequest> instance.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example sets the <xref:System.Net.WebRequest.ContentLength%2A> property to the amount of bytes in the outgoing byte buffer.
[!code-cpp[WebRequest_ContentType#4](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_ContentType/CPP/webrequest_contenttype.cpp#4)]
[!code-csharp[WebRequest_ContentType#4](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_ContentType/CS/webrequest_contenttype.cs#4)]
[!code-vb[WebRequest_ContentType#4](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_ContentType/VB/webrequest_contenttype.vb#4)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class.</exception>
<altmember cref="P:System.Net.HttpWebRequest.ContentLength" />
</Docs>
</Member>
<Member MemberName="ContentType">
<MemberSignature Language="C#" Value="public virtual string ContentType { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ContentType" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.ContentType" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property ContentType As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ ContentType { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.ContentType : string with get, set" Usage="System.Net.WebRequest.ContentType" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>When overridden in a descendant class, gets or sets the content type of the request data being sent.</summary>
<value>The content type of the request data.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.ContentType%2A> property contains the media type of the request. This is typically the MIME encoding of the content.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example sets the <xref:System.Net.WebRequest.ContentType%2A> property to the appropriate media type.
[!code-cpp[WebRequest_ContentType#4](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_ContentType/CPP/webrequest_contenttype.cpp#4)]
[!code-csharp[WebRequest_ContentType#4](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_ContentType/CS/webrequest_contenttype.cs#4)]
[!code-vb[WebRequest_ContentType#4](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_ContentType/VB/webrequest_contenttype.vb#4)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class.</exception>
<altmember cref="P:System.Net.HttpWebRequest.ContentType" />
</Docs>
</Member>
<MemberGroup MemberName="Create">
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new <see cref="T:System.Net.WebRequest" />.</summary>
</Docs>
</MemberGroup>
<Member MemberName="Create">
<MemberSignature Language="C#" Value="public static System.Net.WebRequest Create (string requestUriString);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Net.WebRequest Create(string requestUriString) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.Create(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Create (requestUriString As String) As WebRequest" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Net::WebRequest ^ Create(System::String ^ requestUriString);" />
<MemberSignature Language="F#" Value="static member Create : string -&gt; System.Net.WebRequest" Usage="System.Net.WebRequest.Create requestUriString" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.WebRequest</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="requestUriString" Type="System.String" Index="0" FrameworkAlternate="xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="requestUriString">The URI that identifies the Internet resource.</param>
<summary>Initializes a new <see cref="T:System.Net.WebRequest" /> instance for the specified URI scheme.</summary>
<returns>A <see cref="T:System.Net.WebRequest" /> descendant for the specific URI scheme.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.Create%2A> method returns a descendant of the <xref:System.Net.WebRequest> class determined at run time as the closest registered match for `requestUri`.
For example, when a URI beginning with `http://` or `https://` is passed in `requestUri`, an <xref:System.Net.HttpWebRequest> is returned by <xref:System.Net.WebRequest.Create%2A>. If a URI beginning with `ftp://` is passed instead, the <xref:System.Net.WebRequest.Create%2A> method will return a <xref:System.Net.FtpWebRequest> instance. If a URI beginning with `file://` is passed instead, the <xref:System.Net.WebRequest.Create%2A> method will return a <xref:System.Net.FileWebRequest> instance.
The pre-registered reserve types already registered include the following:
- `http://`
- `https://`
- `ftp://`
- `file://`
.NET includes support for the `http://`, `https://`, `ftp://`, and `file://` URI schemes. Custom <xref:System.Net.WebRequest> descendants to handle other requests are registered with the <xref:System.Net.WebRequest.RegisterPrefix%2A> method.
The <xref:System.Net.WebRequest.Create%2A> method uses the `requestUriString` parameter to create a <xref:System.Uri> instance that it passes to the new <xref:System.Net.WebRequest>.
> [!NOTE]
> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](~/docs/framework/network-programming/network-tracing.md).
## Examples
The following example uses <xref:System.Net.WebRequest.Create%2A> to instantiate an <xref:System.Net.HttpWebRequest> instance. A string representing the target URL is used as the constructor parameter.
[!code-cpp[WebResponse_ResponseUri#1](~/samples/snippets/cpp/VS_Snippets_Remoting/WebResponse_ResponseUri/CPP/webresponse_responseuri.cpp#1)]
[!code-csharp[WebResponse_ResponseUri#1](~/samples/snippets/csharp/VS_Snippets_Remoting/WebResponse_ResponseUri/CS/webresponse_responseuri.cs#1)]
[!code-vb[WebResponse_ResponseUri#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebResponse_ResponseUri/VB/webresponse_responseuri.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The request scheme specified in <paramref name="requestUriString" /> has not been registered.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="requestUriString" /> is <see langword="null" />.</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have <see cref="T:System.Net.WebPermissionAttribute" /> permission to connect to the requested URI or a URI that the request is redirected to.</exception>
<exception cref="T:System.UriFormatException">
<block subset="none" type="note">
<para>
In the <see href="https://go.microsoft.com/fwlink/?LinkID=247912">.NET for Windows Store apps</see> or the <see href="https://docs.microsoft.com/dotnet/standard/cross-platform/cross-platform-development-with-the-portable-class-library">Portable Class Library</see>, catch the base class exception, <see cref="T:System.FormatException" />, instead.
</para>
</block>
The URI specified in <paramref name="requestUriString" /> is not a valid URI.</exception>
<related type="Article" href="~/docs/framework/network-programming/programming-pluggable-protocols.md">Programming Pluggable Protocols</related>
</Docs>
</Member>
<Member MemberName="Create">
<MemberSignature Language="C#" Value="public static System.Net.WebRequest Create (Uri requestUri);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Net.WebRequest Create(class System.Uri requestUri) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.Create(System.Uri)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function Create (requestUri As Uri) As WebRequest" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Net::WebRequest ^ Create(Uri ^ requestUri);" />
<MemberSignature Language="F#" Value="static member Create : Uri -&gt; System.Net.WebRequest" Usage="System.Net.WebRequest.Create requestUri" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.WebRequest</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="requestUri" Type="System.Uri" Index="0" FrameworkAlternate="xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="requestUri">A <see cref="T:System.Uri" /> containing the URI of the requested resource.</param>
<summary>Initializes a new <see cref="T:System.Net.WebRequest" /> instance for the specified URI scheme.</summary>
<returns>A <see cref="T:System.Net.WebRequest" /> descendant for the specified URI scheme.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.Create%2A> method returns a descendant of the <xref:System.Net.WebRequest> class determined at run time as the closest registered match for `requestUri`.
For example, if you create a <xref:System.Net.WebRequest> descendant, Handler1, to handle requests to `http://www.contoso.com/text/` and another named Handler2 to handle requests to `http://www.contoso.com/code/`, you can use <xref:System.Net.WebRequest.Create%2A> method to return the WebRequest descendant associated with either specified URI.
To return a descendant of the <xref:System.Net.WebRequest> class based on only the scheme portion of a URI, use the <xref:System.Net.WebRequest.CreateDefault%2A> method.
For example, when a URI beginning with `http://` or `https://` is passed in `requestUri`, an <xref:System.Net.HttpWebRequest> is returned by <xref:System.Net.WebRequest.Create%2A>. If a URI beginning with `ftp://` is passed instead, the <xref:System.Net.WebRequest.Create%2A> method will return a <xref:System.Net.FileWebRequest> instance. If a URI beginning with `file://` is passed instead, the <xref:System.Net.WebRequest.Create%2A> method will return a <xref:System.Net.FileWebRequest> instance.
The pre-registered reserve types already registered include the following:
- `http://`
- `https://`
- `ftp://`
- `file://`
.NET includes support for the `http://`, `https://`, `ftp://`, and `file://` URI schemes. Custom <xref:System.Net.WebRequest> descendants to handle other requests are registered with the <xref:System.Net.WebRequest.RegisterPrefix%2A> method.
> [!NOTE]
> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in the .NET Framework](~/docs/framework/network-programming/network-tracing.md).
## Examples
The following example uses <xref:System.Net.WebRequest.Create%2A> to instantiate an <xref:System.Net.HttpWebRequest> instance. A Uri representing the target URL is used as the constructor parameter.
[!code-cpp[WebRequest_Create#1](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_Create/CPP/webrequest_create.cpp#1)]
[!code-csharp[WebRequest_Create#1](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_Create/CS/webrequest_create.cs#1)]
[!code-vb[WebRequest_Create#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_Create/VB/webrequest_create.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The request scheme specified in <paramref name="requestUri" /> is not registered.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="requestUri" /> is <see langword="null" />.</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have <see cref="T:System.Net.WebPermissionAttribute" /> permission to connect to the requested URI or a URI that the request is redirected to.</exception>
</Docs>
</Member>
<Member MemberName="CreateDefault">
<MemberSignature Language="C#" Value="public static System.Net.WebRequest CreateDefault (Uri requestUri);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Net.WebRequest CreateDefault(class System.Uri requestUri) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.CreateDefault(System.Uri)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function CreateDefault (requestUri As Uri) As WebRequest" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Net::WebRequest ^ CreateDefault(Uri ^ requestUri);" />
<MemberSignature Language="F#" Value="static member CreateDefault : Uri -&gt; System.Net.WebRequest" Usage="System.Net.WebRequest.CreateDefault requestUri" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.WebRequest</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="requestUri" Type="System.Uri" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="requestUri">A <see cref="T:System.Uri" /> containing the URI of the requested resource.</param>
<summary>Initializes a new <see cref="T:System.Net.WebRequest" /> instance for the specified URI scheme.</summary>
<returns>A <see cref="T:System.Net.WebRequest" /> descendant for the specified URI scheme.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.CreateDefault%2A> method returns a <xref:System.Net.WebRequest> descendant instance based on only the scheme portion of a URI.
For example, when a URI beginning with `http://` is passed in `requestUri`, an <xref:System.Net.HttpWebRequest> is returned by <xref:System.Net.WebRequest.CreateDefault%2A>. If a URI beginning with `file://` is passed instead, the <xref:System.Net.WebRequest.CreateDefault%2A> method will return a <xref:System.Net.FileWebRequest>.
> [!NOTE]
> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing in .NET](~/docs/framework/network-programming/network-tracing.md).
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The request scheme specified in <paramref name="requestUri" /> is not registered.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="requestUri" /> is <see langword="null" />.</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have <see cref="T:System.Net.WebPermissionAttribute" /> permission to connect to the requested URI or a URI that the request is redirected to.</exception>
</Docs>
</Member>
<MemberGroup MemberName="CreateHttp">
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new <see cref="T:System.Net.HttpWebRequest" /> instance for the specified URI.</summary>
</Docs>
</MemberGroup>
<Member MemberName="CreateHttp">
<MemberSignature Language="C#" Value="public static System.Net.HttpWebRequest CreateHttp (string requestUriString);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Net.HttpWebRequest CreateHttp(string requestUriString) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.CreateHttp(System.String)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function CreateHttp (requestUriString As String) As HttpWebRequest" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Net::HttpWebRequest ^ CreateHttp(System::String ^ requestUriString);" />
<MemberSignature Language="F#" Value="static member CreateHttp : string -&gt; System.Net.HttpWebRequest" Usage="System.Net.WebRequest.CreateHttp requestUriString" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.HttpWebRequest</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="requestUriString" Type="System.String" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="requestUriString">A URI string that identifies the Internet resource.</param>
<summary>Initializes a new <see cref="T:System.Net.HttpWebRequest" /> instance for the specified URI string.</summary>
<returns>An <see cref="T:System.Net.HttpWebRequest" /> instance for the specific URI string.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.CreateHttp%28System.String%29> method returns an instance of the <xref:System.Net.HttpWebRequest> class for the `requestUriString`.
When a URI that begins with `http://` or `https://` is passed in the `requestUriString` parameter, a <xref:System.Net.HttpWebRequest> is returned by <xref:System.Net.WebRequest.CreateHttp%28System.String%29>. Any other scheme will throw a <xref:System.NotSupportedException>.
The <xref:System.Net.WebRequest.CreateHttp%28System.String%29> method uses the `requestUriString` parameter to create a <xref:System.Uri> instance that it passes to the new <xref:System.Net.HttpWebRequest>. If the method is successful, the <xref:System.Net.HttpWebRequest.AllowReadStreamBuffering%2A> property on the returned <xref:System.Net.HttpWebRequest> instance is set to `false`.
.NET includes support for the `http://` and `https://` URI schemes. Custom <xref:System.Net.WebRequest> descendants to handle other requests are registered with the <xref:System.Net.WebRequest.RegisterPrefix%2A> method. The <xref:System.Net.WebRequest.Create%28System.String%29> method can be used to create a descendant of the <xref:System.Net.WebRequest> class for other schemes.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The request scheme specified in <paramref name="requestUriString" /> is the http or https scheme.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="requestUriString" /> is <see langword="null" />.</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have <see cref="T:System.Net.WebPermissionAttribute" /> permission to connect to the requested URI or a URI that the request is redirected to.</exception>
<exception cref="T:System.UriFormatException">The URI specified in <paramref name="requestUriString" /> is not a valid URI.</exception>
</Docs>
</Member>
<Member MemberName="CreateHttp">
<MemberSignature Language="C#" Value="public static System.Net.HttpWebRequest CreateHttp (Uri requestUri);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Net.HttpWebRequest CreateHttp(class System.Uri requestUri) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.CreateHttp(System.Uri)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function CreateHttp (requestUri As Uri) As HttpWebRequest" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Net::HttpWebRequest ^ CreateHttp(Uri ^ requestUri);" />
<MemberSignature Language="F#" Value="static member CreateHttp : Uri -&gt; System.Net.HttpWebRequest" Usage="System.Net.WebRequest.CreateHttp requestUri" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.HttpWebRequest</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="requestUri" Type="System.Uri" Index="0" FrameworkAlternate="dotnet-uwp-10.0;netcore-1.0;netcore-1.1;netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;netstandard-2.1;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="requestUri">A URI that identifies the Internet resource.</param>
<summary>Initializes a new <see cref="T:System.Net.HttpWebRequest" /> instance for the specified URI.</summary>
<returns>An <see cref="T:System.Net.HttpWebRequest" /> instance for the specific URI string.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.CreateHttp%28System.Uri%29> method returns an instance of the <xref:System.Net.HttpWebRequest> class for the `requestUri`.
When a URI that begins with `http://` or `http://` is passed in the `requestUri` parameter, an <xref:System.Net.HttpWebRequest> is returned by <xref:System.Net.WebRequest.CreateHttp%28System.Uri%29>. Another other scheme will throw a <xref:System.NotSupportedException>.
The <xref:System.Net.WebRequest.CreateHttp%28System.Uri%29> method uses the `requestUri` parameter to create a new <xref:System.Net.HttpWebRequest> instance. If the method is successful, the <xref:System.Net.HttpWebRequest.AllowReadStreamBuffering%2A> property on the returned <xref:System.Net.HttpWebRequest> instance is set to `false`.
.NET includes support for the `http://` and `https://` URI schemes. Custom <xref:System.Net.WebRequest> descendants to handle other requests are registered with the <xref:System.Net.WebRequest.RegisterPrefix%2A> method. The <xref:System.Net.WebRequest.Create%28System.Uri%29> method can be used to create a descendant of the <xref:System.Net.WebRequest> class for other schemes.
]]></format>
</remarks>
<exception cref="T:System.NotSupportedException">The request scheme specified in <paramref name="requestUri" /> is the http or https scheme.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="requestUri" /> is <see langword="null" />.</exception>
<exception cref="T:System.Security.SecurityException">The caller does not have <see cref="T:System.Net.WebPermissionAttribute" /> permission to connect to the requested URI or a URI that the request is redirected to.</exception>
<exception cref="T:System.UriFormatException">The URI specified in <paramref name="requestUri" /> is not a valid URI.</exception>
</Docs>
</Member>
<Member MemberName="CreatorInstance">
<MemberSignature Language="C#" Value="public virtual System.Net.IWebRequestCreate CreatorInstance { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Net.IWebRequestCreate CreatorInstance" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.CreatorInstance" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property CreatorInstance As IWebRequestCreate" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Net::IWebRequestCreate ^ CreatorInstance { System::Net::IWebRequestCreate ^ get(); };" />
<MemberSignature Language="F#" Value="member this.CreatorInstance : System.Net.IWebRequestCreate" Usage="System.Net.WebRequest.CreatorInstance" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Net.IWebRequestCreate</ReturnType>
</ReturnValue>
<Docs>
<summary>When overridden in a descendant class, gets the factory object derived from the <see cref="T:System.Net.IWebRequestCreate" /> class used to create the <see cref="T:System.Net.WebRequest" /> instantiated for making the request to the specified URI.</summary>
<value>The derived <see cref="T:System.Net.WebRequest" /> type returned by the <see cref="M:System.Net.IWebRequestCreate.Create(System.Uri)" /> method.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This property allows an application to determine which <xref:System.Net.IWebRequestCreate> derived factory object was used to create the request. This object may be [System.Net.Browser.WebRequestCreator.BrowserHttp](https://msdn.microsoft.com/library/system.net.browser.webrequestcreator.browserhttp(v=vs.95)) or [System.Net.Browser.WebRequestCreator.ClientHttp](https://msdn.microsoft.com/library/system.net.browser.webrequestcreator.clienthttp(v=vs.95)), but it may also be a custom instance derived from <xref:System.Net.IWebRequestCreate>. This allows an application to determine whether the browser hosting [!INCLUDE[silverlight](~/includes/silverlight-md.md)], the [!INCLUDE[silverlight](~/includes/silverlight-md.md)] client, or some custom object handles HTTP requests and responses for the <xref:System.Net.WebRequest> instance. The <xref:System.Net.WebRequest.RegisterPrefix%2A> method allows an application to configure which derived <xref:System.Net.WebRequest> type will be instantiated when making a request to a specific URI. <xref:System.Net.WebRequest> creators are typically registered to handle a specific protocol, such HTTP or HTTPS, but can be registered to handle a request to a specific server or path on a server. This is useful when more than one derived <xref:System.Net.WebRequest> type can process requests for the same protocol. The [!INCLUDE[sil3_first](~/includes/sil3-first-md.md)] and later runtime supports multiple HTTP handlers each having different capabilities. For example, a web service that uses Representational State Transfer (REST) might require the [System.Net.Browser.WebRequestCreator.ClientHttp](https://msdn.microsoft.com/library/system.net.browser.webrequestcreator.clienthttp(v=vs.95)) handler while a SOAP web service might be able to use the default [System.Net.Browser.WebRequestCreator.BrowserHttp](https://msdn.microsoft.com/library/system.net.browser.webrequestcreator.browserhttp(v=vs.95)) handler.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Credentials">
<MemberSignature Language="C#" Value="public virtual System.Net.ICredentials Credentials { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Net.ICredentials Credentials" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.Credentials" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property Credentials As ICredentials" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Net::ICredentials ^ Credentials { System::Net::ICredentials ^ get(); void set(System::Net::ICredentials ^ value); };" />
<MemberSignature Language="F#" Value="member this.Credentials : System.Net.ICredentials with get, set" Usage="System.Net.WebRequest.Credentials" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.ICredentials</ReturnType>
</ReturnValue>
<Docs>
<summary>When overridden in a descendant class, gets or sets the network credentials used for authenticating the request with the Internet resource.</summary>
<value>An <see cref="T:System.Net.ICredentials" /> containing the authentication credentials associated with the request. The default is <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.Credentials%2A> property contains the authentication credentials required to access the Internet resource.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example sets the <xref:System.Net.WebRequest.Credentials%2A> property using the default credentials of the current user. When the request is made, credentials stored in this property are used to validate the client. This is identical to setting the <xref:System.Net.WebRequest.UseDefaultCredentials%2A> property to `true`.
[!code-cpp[NclWebRequestSimple#2](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLWebRequestSimple/CPP/webrequestget.cpp#2)]
[!code-csharp[NclWebRequestSimple#2](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLWebRequestSimple/CS/webrequestget.cs#2)]
[!code-vb[NclWebRequestSimple#2](~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLWebRequestSimple/VB/webrequestget.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class.</exception>
<altmember cref="T:System.Net.NetworkCredential" />
<altmember cref="T:System.Net.CredentialCache" />
<altmember cref="P:System.Net.HttpWebRequest.Credentials" />
</Docs>
</Member>
<Member MemberName="DefaultCachePolicy">
<MemberSignature Language="C#" Value="public static System.Net.Cache.RequestCachePolicy DefaultCachePolicy { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property class System.Net.Cache.RequestCachePolicy DefaultCachePolicy" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.DefaultCachePolicy" />
<MemberSignature Language="VB.NET" Value="Public Shared Property DefaultCachePolicy As RequestCachePolicy" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static property System::Net::Cache::RequestCachePolicy ^ DefaultCachePolicy { System::Net::Cache::RequestCachePolicy ^ get(); void set(System::Net::Cache::RequestCachePolicy ^ value); };" />
<MemberSignature Language="F#" Value="member this.DefaultCachePolicy : System.Net.Cache.RequestCachePolicy with get, set" Usage="System.Net.WebRequest.DefaultCachePolicy" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.Cache.RequestCachePolicy</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the default cache policy for this request.</summary>
<value>A <see cref="T:System.Net.Cache.HttpRequestCachePolicy" /> that specifies the cache policy in effect for this request when no other policy is applicable.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This policy is used for this request if the following conditions exist:
- There is no <xref:System.Net.HttpWebRequest.DefaultCachePolicy%2A> property specified for this request.
- The machine and application configuration files do not specify a cache policy that is applicable to the Uniform Resource Identifier (URI) used to create this request.
The cache policy determines whether the requested resource can be taken from a cache instead of sending the request to the resource host computer.
A copy of a resource is only added to the cache if the response stream for the resource is retrieved and read to the end of the stream. So another request for the same resource could use a cached copy, depending on the cache policy level for this request.
## Examples
The following code example demonstrates setting the default cache policy for Web requests.
[!code-cpp[NCLSimpleCache#15](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLSimpleCache/CPP/NCLSimpleCache.cpp#15)]
[!code-csharp[NCLSimpleCache#15](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLSimpleCache/CS/example.cs#15)]
]]></format>
</remarks>
<permission cref="T:System.Net.WebPermission">For unrestricted access to network resources. Associated enumeration: <see cref="F:System.Security.Permissions.PermissionState.Unrestricted" /></permission>
<altmember cref="T:System.Net.Cache.RequestCachePolicy" />
<altmember cref="T:System.Net.Cache.HttpRequestCacheLevel" />
<altmember cref="T:System.Net.Cache.RequestCacheLevel" />
<altmember cref="P:System.Net.HttpWebRequest.DefaultCachePolicy" />
<altmember cref="P:System.Net.WebRequest.CachePolicy" />
</Docs>
</Member>
<Member MemberName="DefaultWebProxy">
<MemberSignature Language="C#" Value="public static System.Net.IWebProxy DefaultWebProxy { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property class System.Net.IWebProxy DefaultWebProxy" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.DefaultWebProxy" />
<MemberSignature Language="VB.NET" Value="Public Shared Property DefaultWebProxy As IWebProxy" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static property System::Net::IWebProxy ^ DefaultWebProxy { System::Net::IWebProxy ^ get(); void set(System::Net::IWebProxy ^ value); };" />
<MemberSignature Language="F#" Value="member this.DefaultWebProxy : System.Net.IWebProxy with get, set" Usage="System.Net.WebRequest.DefaultWebProxy" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.IWebProxy</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the global HTTP proxy.</summary>
<value>An <see cref="T:System.Net.IWebProxy" /> used by every call to instances of <see cref="T:System.Net.WebRequest" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.DefaultWebProxy%2A> property gets or sets the global proxy. The <xref:System.Net.WebRequest.DefaultWebProxy%2A> property determines the default proxy that all <xref:System.Net.WebRequest> instances use if the request supports proxies and no proxy is set explicitly using the <xref:System.Net.HttpWebRequest.Proxy%2A> property. Proxies are currently supported by <xref:System.Net.FtpWebRequest> and <xref:System.Net.HttpWebRequest>.
The <xref:System.Net.WebRequest.DefaultWebProxy%2A> property reads proxy settings from the app.config file. If there is no config file, the current user's Internet Explorer (IE) proxy settings are used.
If the <xref:System.Net.WebRequest.DefaultWebProxy%2A> property is set to null, all subsequent instances of the <xref:System.Net.WebRequest> class created by the <xref:System.Net.WebRequest.Create%2A> or <xref:System.Net.WebRequest.CreateDefault%2A> methods do not have a proxy.
]]></format>
</remarks>
<permission cref="T:System.Net.WebPermission">To get or set the global HTTP proxy. Associated enumeration: <see cref="F:System.Security.Permissions.PermissionState.Unrestricted" /></permission>
</Docs>
</Member>
<Member MemberName="EndGetRequestStream">
<MemberSignature Language="C#" Value="public virtual System.IO.Stream EndGetRequestStream (IAsyncResult asyncResult);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.IO.Stream EndGetRequestStream(class System.IAsyncResult asyncResult) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.EndGetRequestStream(System.IAsyncResult)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function EndGetRequestStream (asyncResult As IAsyncResult) As Stream" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::IO::Stream ^ EndGetRequestStream(IAsyncResult ^ asyncResult);" />
<MemberSignature Language="F#" Value="abstract member EndGetRequestStream : IAsyncResult -&gt; System.IO.Stream&#xA;override this.EndGetRequestStream : IAsyncResult -&gt; System.IO.Stream" Usage="webRequest.EndGetRequestStream asyncResult" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IO.Stream</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="asyncResult" Type="System.IAsyncResult" Index="0" FrameworkAlternate="xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that references a pending request for a stream.</param>
<summary>When overridden in a descendant class, returns a <see cref="T:System.IO.Stream" /> for writing data to the Internet resource.</summary>
<returns>A <see cref="T:System.IO.Stream" /> to write data to.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.EndGetRequestStream%2A> method completes an asynchronous stream request that was started by the <xref:System.Net.WebRequest.BeginGetRequestStream%2A> method.
> [!NOTE]
> To avoid timing issues with garbage collection, be sure to close the response stream by calling the <xref:System.IO.Stream.Close%2A> method on the stream returned by <xref:System.Net.WebResponse.GetResponseStream%2A> after calling <xref:System.Net.WebRequest.EndGetResponse%2A>.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example obtains and uses the request stream by calling the <xref:System.Net.WebRequest.EndGetRequestStream%2A>. The <xref:System.Net.WebRequest.EndGetRequestStream%2A> method completes the asynchronous call to <xref:System.Net.WebRequest.BeginGetRequestStream%2A>.
[!code-cpp[WebRequest_BeginGetRequest#3](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_BeginGetRequest/CPP/webrequest_begingetrequest.cpp#3)]
[!code-csharp[WebRequest_BeginGetRequest#3](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_BeginGetRequest/CS/webrequest_begingetrequest.cs#3)]
[!code-vb[WebRequest_BeginGetRequest#3](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_BeginGetRequest/VB/webrequest_begingetrequest.vb#3)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class.</exception>
<altmember cref="M:System.Net.WebRequest.BeginGetRequestStream(System.AsyncCallback,System.Object)" />
<related type="Article" href="~/docs/framework/network-programming/making-asynchronous-requests.md">Making Asynchronous Requests</related>
</Docs>
</Member>
<Member MemberName="EndGetResponse">
<MemberSignature Language="C#" Value="public virtual System.Net.WebResponse EndGetResponse (IAsyncResult asyncResult);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Net.WebResponse EndGetResponse(class System.IAsyncResult asyncResult) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.EndGetResponse(System.IAsyncResult)" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function EndGetResponse (asyncResult As IAsyncResult) As WebResponse" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Net::WebResponse ^ EndGetResponse(IAsyncResult ^ asyncResult);" />
<MemberSignature Language="F#" Value="abstract member EndGetResponse : IAsyncResult -&gt; System.Net.WebResponse&#xA;override this.EndGetResponse : IAsyncResult -&gt; System.Net.WebResponse" Usage="webRequest.EndGetResponse asyncResult" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.WebResponse</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="asyncResult" Type="System.IAsyncResult" Index="0" FrameworkAlternate="xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="asyncResult">An <see cref="T:System.IAsyncResult" /> that references a pending request for a response.</param>
<summary>When overridden in a descendant class, returns a <see cref="T:System.Net.WebResponse" />.</summary>
<returns>A <see cref="T:System.Net.WebResponse" /> that contains a response to the Internet request.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.EndGetResponse%2A> method completes an asynchronous request for an Internet resource that was started with the <xref:System.Net.WebRequest.BeginGetResponse%2A> method.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example calls the <xref:System.Net.WebRequest.EndGetResponse%2A> to retrieve the target resource.
[!code-cpp[WebRequest_BeginGetResponse#1](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_BeginGetResponse/CPP/webrequest_begingetresponse.cpp#1)]
[!code-csharp[WebRequest_BeginGetResponse#1](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_BeginGetResponse/CS/webrequest_begingetresponse.cs#1)]
[!code-vb[WebRequest_BeginGetResponse#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_BeginGetResponse/VB/webrequest_begingetresponse.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class.</exception>
<altmember cref="M:System.Net.WebRequest.BeginGetResponse(System.AsyncCallback,System.Object)" />
<related type="Article" href="~/docs/framework/network-programming/making-asynchronous-requests.md">Making Asynchronous Requests</related>
</Docs>
</Member>
<Member MemberName="GetObjectData">
<MemberSignature Language="C#" Value="protected virtual void GetObjectData (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig newslot virtual instance void GetObjectData(class System.Runtime.Serialization.SerializationInfo serializationInfo, valuetype System.Runtime.Serialization.StreamingContext streamingContext) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; virtual void GetObjectData(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);" />
<MemberSignature Language="F#" Value="abstract member GetObjectData : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -&gt; unit&#xA;override this.GetObjectData : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -&gt; unit" Usage="webRequest.GetObjectData (serializationInfo, streamingContext)" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="serializationInfo" Type="System.Runtime.Serialization.SerializationInfo" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="streamingContext" Type="System.Runtime.Serialization.StreamingContext" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="serializationInfo">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> to populate with data.</param>
<param name="streamingContext">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> that specifies the destination for this serialization.</param>
<summary>Populates a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> with the data needed to serialize the target object.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Any objects included in the <xref:System.Runtime.Serialization.SerializationInfo> are automatically tracked and serialized by the formatter.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetRequestStream">
<MemberSignature Language="C#" Value="public virtual System.IO.Stream GetRequestStream ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.IO.Stream GetRequestStream() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.GetRequestStream" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetRequestStream () As Stream" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::IO::Stream ^ GetRequestStream();" />
<MemberSignature Language="F#" Value="abstract member GetRequestStream : unit -&gt; System.IO.Stream&#xA;override this.GetRequestStream : unit -&gt; System.IO.Stream" Usage="webRequest.GetRequestStream " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IO.Stream</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>When overridden in a descendant class, returns a <see cref="T:System.IO.Stream" /> for writing data to the Internet resource.</summary>
<returns>A <see cref="T:System.IO.Stream" /> for writing data to the Internet resource.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.GetRequestStream%2A> method initiates a request to send data to the Internet resource and returns a <xref:System.IO.Stream> instance for sending data to the Internet resource.
The <xref:System.Net.WebRequest.GetRequestStream%2A> method provides synchronous access to the <xref:System.IO.Stream>. For asynchronous access, use the <xref:System.Net.WebRequest.BeginGetRequestStream%2A> and <xref:System.Net.WebRequest.EndGetRequestStream%2A> methods.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example uses the <xref:System.Net.WebRequest.GetRequestStream%2A> method to obtain a stream and then writes data that stream.
[!code-cpp[WebRequest_ContentType#4](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_ContentType/CPP/webrequest_contenttype.cpp#4)]
[!code-csharp[WebRequest_ContentType#4](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_ContentType/CS/webrequest_contenttype.cs#4)]
[!code-vb[WebRequest_ContentType#4](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_ContentType/VB/webrequest_contenttype.vb#4)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class.</exception>
<altmember cref="M:System.Net.WebRequest.BeginGetRequestStream(System.AsyncCallback,System.Object)" />
<related type="Article" href="~/docs/framework/network-programming/using-streams-on-the-network.md">Using Streams on the Network</related>
</Docs>
</Member>
<Member MemberName="GetRequestStreamAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task&lt;System.IO.Stream&gt; GetRequestStreamAsync ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1&lt;class System.IO.Stream&gt; GetRequestStreamAsync() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.GetRequestStreamAsync" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetRequestStreamAsync () As Task(Of Stream)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Threading::Tasks::Task&lt;System::IO::Stream ^&gt; ^ GetRequestStreamAsync();" />
<MemberSignature Language="F#" Value="abstract member GetRequestStreamAsync : unit -&gt; System.Threading.Tasks.Task&lt;System.IO.Stream&gt;&#xA;override this.GetRequestStreamAsync : unit -&gt; System.Threading.Tasks.Task&lt;System.IO.Stream&gt;" Usage="webRequest.GetRequestStreamAsync " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task&lt;System.IO.Stream&gt;</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>When overridden in a descendant class, returns a <see cref="T:System.IO.Stream" /> for writing data to the Internet resource as an asynchronous operation.</summary>
<returns>The task object representing the asynchronous operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This operation will not block. The returned <xref:System.Threading.Tasks.Task%601> object will complete when the <xref:System.IO.Stream> for writing data to the Internet resource is available.
After you call <xref:System.Net.WebRequest.GetRequestStreamAsync%2A>, make sure you close the request stream before you call <xref:System.Net.WebRequest.GetResponseAsync%2A>.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetResponse">
<MemberSignature Language="C#" Value="public virtual System.Net.WebResponse GetResponse ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Net.WebResponse GetResponse() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.GetResponse" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetResponse () As WebResponse" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Net::WebResponse ^ GetResponse();" />
<MemberSignature Language="F#" Value="abstract member GetResponse : unit -&gt; System.Net.WebResponse&#xA;override this.GetResponse : unit -&gt; System.Net.WebResponse" Usage="webRequest.GetResponse " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.WebResponse</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>When overridden in a descendant class, returns a response to an Internet request.</summary>
<returns>A <see cref="T:System.Net.WebResponse" /> containing the response to the Internet request.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.GetResponse%2A> method sends a request to an Internet resource and returns a <xref:System.Net.WebResponse> instance. If the request has already been initiated by a call to <xref:System.Net.WebRequest.GetRequestStream%2A>, the <xref:System.Net.WebRequest.GetResponse%2A> method completes the request and returns any response.
The <xref:System.Net.WebRequest.GetResponse%2A> method provides synchronous access to the <xref:System.Net.WebResponse>. For asynchronous access, use the <xref:System.Net.WebRequest.BeginGetResponse%2A> and <xref:System.Net.WebRequest.EndGetResponse%2A> methods.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
> [!NOTE]
> If a WebException is thrown, use the <xref:System.Net.WebException.Response%2A> and <xref:System.Net.WebException.Status%2A> properties of the exception to determine the response from the server.
## Examples
The following example sets the <xref:System.Net.WebRequest.Timeout%2A> property to 10000 milliseconds. If the timeout period expires before the resource can be returned, a <xref:System.Net.WebException> is thrown.
[!code-cpp[WebRequest_Timeout#1](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_Timeout/CPP/webrequest_timeout.cpp#1)]
[!code-csharp[WebRequest_Timeout#1](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_Timeout/CS/webrequest_timeout.cs#1)]
[!code-vb[WebRequest_Timeout#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_Timeout/VB/webrequest_timeout.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to access the method, when the method is not overridden in a descendant class.</exception>
<altmember cref="M:System.Net.WebRequest.BeginGetResponse(System.AsyncCallback,System.Object)" />
<altmember cref="T:System.Net.WebResponse" />
</Docs>
</Member>
<Member MemberName="GetResponseAsync">
<MemberSignature Language="C#" Value="public virtual System.Threading.Tasks.Task&lt;System.Net.WebResponse&gt; GetResponseAsync ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig newslot virtual instance class System.Threading.Tasks.Task`1&lt;class System.Net.WebResponse&gt; GetResponseAsync() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.GetResponseAsync" />
<MemberSignature Language="VB.NET" Value="Public Overridable Function GetResponseAsync () As Task(Of WebResponse)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual System::Threading::Tasks::Task&lt;System::Net::WebResponse ^&gt; ^ GetResponseAsync();" />
<MemberSignature Language="F#" Value="abstract member GetResponseAsync : unit -&gt; System.Threading.Tasks.Task&lt;System.Net.WebResponse&gt;&#xA;override this.GetResponseAsync : unit -&gt; System.Threading.Tasks.Task&lt;System.Net.WebResponse&gt;" Usage="webRequest.GetResponseAsync " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Threading.Tasks.Task&lt;System.Net.WebResponse&gt;</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>When overridden in a descendant class, returns a response to an Internet request as an asynchronous operation.</summary>
<returns>The task object representing the asynchronous operation.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
This operation will not block. The returned <xref:System.Threading.Tasks.Task%601> object will complete after a response to an Internet request is available.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="GetSystemWebProxy">
<MemberSignature Language="C#" Value="public static System.Net.IWebProxy GetSystemWebProxy ();" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig class System.Net.IWebProxy GetSystemWebProxy() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.GetSystemWebProxy" />
<MemberSignature Language="VB.NET" Value="Public Shared Function GetSystemWebProxy () As IWebProxy" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static System::Net::IWebProxy ^ GetSystemWebProxy();" />
<MemberSignature Language="F#" Value="static member GetSystemWebProxy : unit -&gt; System.Net.IWebProxy" Usage="System.Net.WebRequest.GetSystemWebProxy " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.IWebProxy</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Returns a proxy configured with the Internet Explorer settings of the currently impersonated user.</summary>
<returns>An <see cref="T:System.Net.IWebProxy" /> used by every call to instances of <see cref="T:System.Net.WebRequest" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
<xref:System.Net.WebRequest.GetSystemWebProxy%2A> method reads the current user's Internet Explorer (IE) proxy settings. This process includes the IE options to automatically detect proxy settings, use an automatic configuration script, manual proxy server settings, and advanced manual proxy server settings.
If your application is impersonating several users, you can use the <xref:System.Net.WebRequest.GetSystemWebProxy%2A> method to retrieve a proxy for each impersonated user.
]]></format>
</remarks>
<permission cref="T:System.Net.WebPermission">To get or set the global HTTP proxy. Associated enumeration: <see cref="F:System.Security.Permissions.PermissionState.Unrestricted" /></permission>
</Docs>
</Member>
<Member MemberName="Headers">
<MemberSignature Language="C#" Value="public virtual System.Net.WebHeaderCollection Headers { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Net.WebHeaderCollection Headers" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.Headers" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property Headers As WebHeaderCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Net::WebHeaderCollection ^ Headers { System::Net::WebHeaderCollection ^ get(); void set(System::Net::WebHeaderCollection ^ value); };" />
<MemberSignature Language="F#" Value="member this.Headers : System.Net.WebHeaderCollection with get, set" Usage="System.Net.WebRequest.Headers" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.WebHeaderCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>When overridden in a descendant class, gets or sets the collection of header name/value pairs associated with the request.</summary>
<value>A <see cref="T:System.Net.WebHeaderCollection" /> containing the header name/value pairs associated with this request.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.Headers%2A> property contains a <xref:System.Net.WebHeaderCollection> instance containing the header information to send to the Internet resource.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example displays the header name/value pairs associated with this request.
[!code-cpp[WebRequest_Headers#1](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_Headers/CPP/webrequest_headers.cpp#1)]
[!code-csharp[WebRequest_Headers#1](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_Headers/CS/webrequest_headers.cs#1)]
[!code-vb[WebRequest_Headers#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_Headers/VB/webrequest_headers.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class.</exception>
<altmember cref="T:System.Net.WebHeaderCollection" />
<altmember cref="P:System.Net.HttpWebRequest.Headers" />
</Docs>
</Member>
<Member MemberName="ImpersonationLevel">
<MemberSignature Language="C#" Value="public System.Security.Principal.TokenImpersonationLevel ImpersonationLevel { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Security.Principal.TokenImpersonationLevel ImpersonationLevel" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.ImpersonationLevel" />
<MemberSignature Language="VB.NET" Value="Public Property ImpersonationLevel As TokenImpersonationLevel" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Security::Principal::TokenImpersonationLevel ImpersonationLevel { System::Security::Principal::TokenImpersonationLevel get(); void set(System::Security::Principal::TokenImpersonationLevel value); };" />
<MemberSignature Language="F#" Value="member this.ImpersonationLevel : System.Security.Principal.TokenImpersonationLevel with get, set" Usage="System.Net.WebRequest.ImpersonationLevel" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>set: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Security.Principal.TokenImpersonationLevel</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the impersonation level for the current request.</summary>
<value>A <see cref="T:System.Security.Principal.TokenImpersonationLevel" /> value.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The impersonation level determines how the server can use the client's credentials.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Method">
<MemberSignature Language="C#" Value="public virtual string Method { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Method" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.Method" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property Method As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::String ^ Method { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Method : string with get, set" Usage="System.Net.WebRequest.Method" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.String</ReturnType>
</ReturnValue>
<Docs>
<summary>When overridden in a descendant class, gets or sets the protocol method to use in this request.</summary>
<value>The protocol method to use in this request.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When overridden in a descendant class, the <xref:System.Net.WebRequest.Method%2A> property contains the request method to use in this request.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example sets the <xref:System.Net.WebRequest.Method%2A> property to POST to indicate that the request will post data to the target host.
[!code-cpp[WebRequest_BeginGetRequest#3](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_BeginGetRequest/CPP/webrequest_begingetrequest.cpp#3)]
[!code-csharp[WebRequest_BeginGetRequest#3](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_BeginGetRequest/CS/webrequest_begingetrequest.cs#3)]
[!code-vb[WebRequest_BeginGetRequest#3](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_BeginGetRequest/VB/webrequest_begingetrequest.vb#3)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">If the property is not overridden in a descendant class, any attempt is made to get or set the property.</exception>
<block subset="none" type="overrides">
<para>The <see cref="P:System.Net.WebRequest.Method" /> property can contain any valid request method for the protocol implemented. The default value must provide a default request/response transaction that does not require protocol-specific properties to be set.</para>
</block>
<altmember cref="P:System.Net.HttpWebRequest.Method" />
</Docs>
</Member>
<Member MemberName="PreAuthenticate">
<MemberSignature Language="C#" Value="public virtual bool PreAuthenticate { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool PreAuthenticate" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.PreAuthenticate" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property PreAuthenticate As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool PreAuthenticate { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.PreAuthenticate : bool with get, set" Usage="System.Net.WebRequest.PreAuthenticate" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>When overridden in a descendant class, indicates whether to pre-authenticate the request.</summary>
<value>
<see langword="true" /> to pre-authenticate; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
With the exception of the first request, the <xref:System.Net.WebRequest.PreAuthenticate%2A> property indicates whether to send authentication information with subsequent requests without waiting to be challenged by the server. When <xref:System.Net.WebRequest.PreAuthenticate%2A> is `false`, the <xref:System.Net.WebRequest> waits for an authentication challenge before sending authentication information.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example sets the <xref:System.Net.WebRequest.PreAuthenticate%2A> property to `true` so that the <xref:System.Net.NetworkCredential> stored in the <xref:System.Net.WebRequest.Credentials%2A> property will be sent to along with the resource request.
[!code-cpp[WebRequest_PreAuthenticate#1](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_PreAuthenticate/CPP/webrequest_preauthenticate.cpp#1)]
[!code-csharp[WebRequest_PreAuthenticate#1](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_PreAuthenticate/CS/webrequest_preauthenticate.cs#1)]
[!code-vb[WebRequest_PreAuthenticate#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_PreAuthenticate/VB/webrequest_preauthenticate.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class.</exception>
<altmember cref="P:System.Net.HttpWebRequest.PreAuthenticate" />
</Docs>
</Member>
<Member MemberName="Proxy">
<MemberSignature Language="C#" Value="public virtual System.Net.IWebProxy Proxy { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Net.IWebProxy Proxy" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.Proxy" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property Proxy As IWebProxy" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Net::IWebProxy ^ Proxy { System::Net::IWebProxy ^ get(); void set(System::Net::IWebProxy ^ value); };" />
<MemberSignature Language="F#" Value="member this.Proxy : System.Net.IWebProxy with get, set" Usage="System.Net.WebRequest.Proxy" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.IWebProxy</ReturnType>
</ReturnValue>
<Docs>
<summary>When overridden in a descendant class, gets or sets the network proxy to use to access this Internet resource.</summary>
<value>The <see cref="T:System.Net.IWebProxy" /> to use to access the Internet resource.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.Proxy%2A> property identifies the network proxy that the request uses to access the Internet resource. The request is made through the proxy server rather than directly to the Internet resource.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example displays the current network proxy address and allows the user to assign a new network proxy address and port number.
[!code-cpp[WebRequest_Proxy#1](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_Proxy/CPP/webrequest_proxy.cpp#1)]
[!code-csharp[WebRequest_Proxy#1](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_Proxy/CS/webrequest_proxy.cs#1)]
[!code-vb[WebRequest_Proxy#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_Proxy/VB/webrequest_proxy.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class.</exception>
<altmember cref="T:System.Net.IWebProxy" />
<altmember cref="T:System.Net.WebProxy" />
<altmember cref="P:System.Net.HttpWebRequest.Proxy" />
</Docs>
</Member>
<Member MemberName="RegisterPortableWebRequestCreator">
<MemberSignature Language="C#" Value="public static void RegisterPortableWebRequestCreator (System.Net.IWebRequestCreate creator);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig void RegisterPortableWebRequestCreator(class System.Net.IWebRequestCreate creator) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.RegisterPortableWebRequestCreator(System.Net.IWebRequestCreate)" />
<MemberSignature Language="VB.NET" Value="Public Shared Sub RegisterPortableWebRequestCreator (creator As IWebRequestCreate)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static void RegisterPortableWebRequestCreator(System::Net::IWebRequestCreate ^ creator);" />
<MemberSignature Language="F#" Value="static member RegisterPortableWebRequestCreator : System.Net.IWebRequestCreate -&gt; unit" Usage="System.Net.WebRequest.RegisterPortableWebRequestCreator creator" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>System.Obsolete("This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.", true)</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="creator" Type="System.Net.IWebRequestCreate" Index="0" FrameworkAlternate="netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="creator">The <see cref="T:System.Net.IWebRequestCreate" /> object to register.</param>
<summary>Register an <see cref="T:System.Net.IWebRequestCreate" /> object.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="RegisterPrefix">
<MemberSignature Language="C#" Value="public static bool RegisterPrefix (string prefix, System.Net.IWebRequestCreate creator);" />
<MemberSignature Language="ILAsm" Value=".method public static hidebysig bool RegisterPrefix(string prefix, class System.Net.IWebRequestCreate creator) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.RegisterPrefix(System.String,System.Net.IWebRequestCreate)" />
<MemberSignature Language="VB.NET" Value="Public Shared Function RegisterPrefix (prefix As String, creator As IWebRequestCreate) As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static bool RegisterPrefix(System::String ^ prefix, System::Net::IWebRequestCreate ^ creator);" />
<MemberSignature Language="F#" Value="static member RegisterPrefix : string * System.Net.IWebRequestCreate -&gt; bool" Usage="System.Net.WebRequest.RegisterPrefix (prefix, creator)" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="prefix" Type="System.String" Index="0" FrameworkAlternate="xamarinmac-3.0" />
<Parameter Name="creator" Type="System.Net.IWebRequestCreate" Index="1" FrameworkAlternate="xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="prefix">The complete URI or URI prefix that the <see cref="T:System.Net.WebRequest" /> descendant services.</param>
<param name="creator">The create method that the <see cref="T:System.Net.WebRequest" /> calls to create the <see cref="T:System.Net.WebRequest" /> descendant.</param>
<summary>Registers a <see cref="T:System.Net.WebRequest" /> descendant for the specified URI.</summary>
<returns>
<see langword="true" /> if registration is successful; otherwise, <see langword="false" />.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.RegisterPrefix%2A> method registers <xref:System.Net.WebRequest> descendants to service requests. <xref:System.Net.WebRequest> descendants are typically registered to handle a specific protocol, such HTTP or FTP, but can be registered to handle a request to a specific server or path on a server.
The pre-registered reserve types already registered include the following:
- `http://`
- `https://`
- `ftp://`
- `file://`
For more information, see the <xref:System.Net.WebRequest.Create%28System.String%29> and <xref:System.Net.WebRequest.Create%28System.Uri%29> methods.
Duplicate prefixes are not allowed. <xref:System.Net.WebRequest.RegisterPrefix%2A> returns `false` if an attempt is made to register a duplicate prefix.
> [!NOTE]
> The <xref:System.Net.HttpWebRequest> class is registered to service requests for HTTP and HTTPS schemes by default. Attempts to register a different <xref:System.Net.WebRequest> descendant for these schemes will fail.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="prefix" /> is <see langword="null" />
-or-
<paramref name="creator" /> is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="RequestUri">
<MemberSignature Language="C#" Value="public virtual Uri RequestUri { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Uri RequestUri" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.RequestUri" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property RequestUri As Uri" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property Uri ^ RequestUri { Uri ^ get(); };" />
<MemberSignature Language="F#" Value="member this.RequestUri : Uri" Usage="System.Net.WebRequest.RequestUri" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Uri</ReturnType>
</ReturnValue>
<Docs>
<summary>When overridden in a descendant class, gets the URI of the Internet resource associated with the request.</summary>
<value>A <see cref="T:System.Uri" /> representing the resource associated with the request</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When overridden in a descendant class, the <xref:System.Net.WebRequest.RequestUri%2A> property contains the <xref:System.Uri> instance that <xref:System.Net.WebRequest.Create%2A> method uses to create the request.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example checks the <xref:System.Net.WebRequest.RequestUri%2A> property to determine the site originally requested.
[!code-cpp[WebRequest_RequestUri1#1](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_RequestUri1/CPP/webrequest_requesturi.cpp#1)]
[!code-csharp[WebRequest_RequestUri1#1](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_RequestUri1/CS/webrequest_requesturi.cs#1)]
[!code-vb[WebRequest_RequestUri1#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_RequestUri1/VB/webrequest_requesturi.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class.</exception>
<block subset="none" type="overrides">
<para>
<see cref="P:System.Net.WebRequest.RequestUri" /> must contain the original <see cref="T:System.Uri" /> instance passed to the <see cref="M:System.Net.WebRequest.Create(System.Uri)" /> method. If the protocol is able to redirect the request to a different URI to service the request, the descendant must provide a property to contain the URI that actually services the request</para>
</block>
<altmember cref="P:System.Net.HttpWebRequest.RequestUri" />
<altmember cref="P:System.Net.HttpWebRequest.Address" />
</Docs>
</Member>
<Member MemberName="System.Runtime.Serialization.ISerializable.GetObjectData">
<MemberSignature Language="C#" Value="void ISerializable.GetObjectData (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);" />
<MemberSignature Language="ILAsm" Value=".method hidebysig newslot virtual instance void System.Runtime.Serialization.ISerializable.GetObjectData(class System.Runtime.Serialization.SerializationInfo serializationInfo, valuetype System.Runtime.Serialization.StreamingContext streamingContext) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.WebRequest.System#Runtime#Serialization#ISerializable#GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
<MemberSignature Language="C++ CLI" Value=" virtual void System.Runtime.Serialization.ISerializable.GetObjectData(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext) = System::Runtime::Serialization::ISerializable::GetObjectData;" />
<MemberType>Method</MemberType>
<Implements>
<InterfaceMember>M:System.Runtime.Serialization.ISerializable.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)</InterfaceMember>
</Implements>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName>System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="serializationInfo" Type="System.Runtime.Serialization.SerializationInfo" Index="0" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
<Parameter Name="streamingContext" Type="System.Runtime.Serialization.StreamingContext" Index="1" FrameworkAlternate="netcore-2.0;netcore-2.1;netcore-2.2;netcore-3.0;netframework-1.1;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netstandard-2.0;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netstandard-2.1" />
</Parameters>
<Docs>
<param name="serializationInfo">A <see cref="T:System.Runtime.Serialization.SerializationInfo" />, which holds the serialized data for the <see cref="T:System.Net.WebRequest" />.</param>
<param name="streamingContext">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains the destination of the serialized stream associated with the new <see cref="T:System.Net.WebRequest" />.</param>
<summary>When overridden in a descendant class, populates a <see cref="T:System.Runtime.Serialization.SerializationInfo" /> instance with the data needed to serialize the <see cref="T:System.Net.WebRequest" />.</summary>
<remarks>To be added.</remarks>
<exception cref="T:System.NotImplementedException">An attempt is made to serialize the object, when the interface is not overridden in a descendant class.</exception>
</Docs>
</Member>
<Member MemberName="Timeout">
<MemberSignature Language="C#" Value="public virtual int Timeout { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 Timeout" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.Timeout" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property Timeout As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property int Timeout { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.Timeout : int with get, set" Usage="System.Net.WebRequest.Timeout" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the length of time, in milliseconds, before the request times out.</summary>
<value>The length of time, in milliseconds, until the request times out, or the value <see cref="F:System.Threading.Timeout.Infinite" /> to indicate that the request does not time out. The default value is defined by the descendant class.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.WebRequest.Timeout%2A> property indicates the length of time, in milliseconds, until the request times out and throws a <xref:System.Net.WebException>. The <xref:System.Net.WebRequest.Timeout%2A> property affects only synchronous requests made with the <xref:System.Net.WebRequest.GetResponse%2A> method. To time out asynchronous requests, use the <xref:System.Net.WebRequest.Abort%2A> method.
> [!NOTE]
> The <xref:System.Net.WebRequest> class is an `abstract` class. The actual behavior of <xref:System.Net.WebRequest> instances at run time is determined by the descendant class returned by the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method. For more information about default values and exceptions, see the documentation for the descendant classes, such as <xref:System.Net.HttpWebRequest> and <xref:System.Net.FileWebRequest>.
## Examples
The following example sets the <xref:System.Net.WebRequest.Timeout%2A> property to 10000 milliseconds. If the timeout period expires before the resource can be returned, a <xref:System.Net.WebException> is thrown.
[!code-cpp[WebRequest_Timeout#1](~/samples/snippets/cpp/VS_Snippets_Remoting/WebRequest_Timeout/CPP/webrequest_timeout.cpp#1)]
[!code-csharp[WebRequest_Timeout#1](~/samples/snippets/csharp/VS_Snippets_Remoting/WebRequest_Timeout/CS/webrequest_timeout.cs#1)]
[!code-vb[WebRequest_Timeout#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/WebRequest_Timeout/VB/webrequest_timeout.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.NotImplementedException">Any attempt is made to get or set the property, when the property is not overridden in a descendant class.</exception>
<block subset="none" type="overrides">
<para>Descendant classes signal a timeout by throwing a <see cref="T:System.Net.WebException" /> with the <see cref="P:System.Net.WebException.Status" /> field set to <see cref="F:System.Net.WebExceptionStatus.Timeout" />. When <see cref="P:System.Net.WebRequest.Timeout" /> is set to <see cref="F:System.Threading.Timeout.Infinite" /> the descendant class does not time out.</para>
</block>
<altmember cref="P:System.Net.HttpWebRequest.Timeout" />
</Docs>
</Member>
<Member MemberName="UseDefaultCredentials">
<MemberSignature Language="C#" Value="public virtual bool UseDefaultCredentials { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool UseDefaultCredentials" />
<MemberSignature Language="DocId" Value="P:System.Net.WebRequest.UseDefaultCredentials" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property UseDefaultCredentials As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool UseDefaultCredentials { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.UseDefaultCredentials : bool with get, set" Usage="System.Net.WebRequest.UseDefaultCredentials" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.1.1.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>When overridden in a descendant class, gets or sets a <see cref="T:System.Boolean" /> value that controls whether <see cref="P:System.Net.CredentialCache.DefaultCredentials" /> are sent with requests.</summary>
<value>
<see langword="true" /> if the default credentials are used; otherwise <see langword="false" />. The default value is <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Set this property to `true` when requests made by this <xref:System.Net.WebRequest> object should, if requested by the server, be authenticated using the credentials of the currently logged on user. For client applications, this is the desired behavior in most scenarios. For middle tier applications, such as ASP.NET applications, instead of using this property, you would typically set the <xref:System.Net.WebRequest.Credentials%2A> property to the credentials of the client on whose behalf the request is made.
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">You attempted to set this property after the request was sent.</exception>
<exception cref="T:System.NotImplementedException">Any attempt is made to access the property, when the property is not overridden in a descendant class.</exception>
</Docs>
</Member>
</Members>
</Type>
You can’t perform that action at this time.