Permalink
Fetching contributors…
Cannot retrieve contributors at this time
4492 lines (3899 sloc) 283 KB
<Type Name="HttpWebRequest" FullName="System.Net.HttpWebRequest">
<TypeSignature Language="C#" Value="public class HttpWebRequest : System.Net.WebRequest, System.Runtime.Serialization.ISerializable" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi serializable HttpWebRequest extends System.Net.WebRequest implements class System.Runtime.Serialization.ISerializable" />
<TypeSignature Language="DocId" Value="T:System.Net.HttpWebRequest" />
<TypeSignature Language="VB.NET" Value="Public Class HttpWebRequest&#xA;Inherits WebRequest&#xA;Implements ISerializable" />
<TypeSignature Language="C++ CLI" Value="public ref class HttpWebRequest : System::Net::WebRequest, System::Runtime::Serialization::ISerializable" />
<TypeSignature Language="F#" Value="type HttpWebRequest = class&#xA; inherit WebRequest&#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>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Net.WebRequest</BaseTypeName>
</Base>
<Interfaces>
<Interface>
<InterfaceName>System.Runtime.Serialization.ISerializable</InterfaceName>
</Interface>
</Interfaces>
<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;netframework-4.8">
<AttributeName>System.Runtime.CompilerServices.FriendAccessAllowed</AttributeName>
</Attribute>
<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;xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0;netframework-4.8">
<AttributeName>Serializable</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Provides an HTTP-specific implementation of the <see cref="T:System.Net.WebRequest" /> class.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
> [!IMPORTANT]
> We don't recommend that you use `HttpWebRequest` for new development. Instead, use the <xref:System.Net.Http.HttpClient?displayProperty=nameWithType> class.
The <xref:System.Net.HttpWebRequest> class provides support for the properties and methods defined in <xref:System.Net.WebRequest> and for additional properties and methods that enable the user to interact directly with servers using HTTP.
Do not use the <xref:System.Net.HttpWebRequest.%23ctor%2A> constructor. Use the <xref:System.Net.WebRequest.Create%2A?displayProperty=nameWithType> method to initialize new <xref:System.Net.HttpWebRequest> objects. If the scheme for the Uniform Resource Identifier (URI) is `http://` or `https://`, <xref:System.Net.WebRequest.Create%2A> returns an <xref:System.Net.HttpWebRequest> object.
The <xref:System.Net.HttpWebRequest.GetResponse%2A> method makes a synchronous request to the resource specified in the <xref:System.Net.HttpWebRequest.RequestUri%2A> property and returns an <xref:System.Net.HttpWebResponse> that contains the response object. The response data can be received by using the stream returned by <xref:System.Net.HttpWebResponse.GetResponseStream%2A>. If the response object or the response stream is closed, remaining data will be forfeited. The remaining data will be drained and the socket will be re-used for subsequent requests when closing the response object or stream if the following conditions hold: it's a keep-alive or pipelined request, only a small amount of data needs to be received, or the remaining data is received in a small time interval. If none of the mentioned conditions hold or the drain time is exceeded, the socket will be closed. For keep-alive or pipelined connections, we strongly recommend that the application reads the streams until EOF. This ensures that the socket will be re-used for subsequent requests resulting in better performance and less resources used.
When you want to send data to the resource, the <xref:System.Net.HttpWebRequest.GetRequestStream%2A> method returns a <xref:System.IO.Stream> object to use to send data. The <xref:System.Net.HttpWebRequest.BeginGetRequestStream%2A> and <xref:System.Net.HttpWebRequest.EndGetRequestStream%2A> methods provide asynchronous access to the send data stream.
For client authentication with <xref:System.Net.HttpWebRequest>, the client certificate must be installed in the My certificate store of the current user.
The <xref:System.Net.HttpWebRequest> class throws a <xref:System.Net.WebException> when errors occur while accessing a resource. The <xref:System.Net.WebException.Status%2A?displayProperty=nameWithType> property contains a <xref:System.Net.WebExceptionStatus> value that indicates the source of the error. When <xref:System.Net.WebException.Status%2A?displayProperty=nameWithType> is <xref:System.Net.WebExceptionStatus.ProtocolError?displayProperty=nameWithType>, the <xref:System.Net.WebException.Response%2A> property contains the <xref:System.Net.HttpWebResponse> received from the resource.
<xref:System.Net.HttpWebRequest> exposes common HTTP header values sent to the Internet resource as properties, set by methods, or set by the system; the following table contains a complete list. You can set other headers in the <xref:System.Net.HttpWebRequest.Headers%2A> property as name/value pairs. Note that servers and caches may change or add headers during the request.
The following table lists the HTTP headers that are set either by properties or methods or the system.
|Header|Set by|
|------------|------------|
|Accept|Set by the <xref:System.Net.HttpWebRequest.Accept%2A> property.|
|Connection|Set by the <xref:System.Net.HttpWebRequest.Connection%2A> property, <xref:System.Net.HttpWebRequest.KeepAlive%2A> property.|
|Content-Length|Set by the <xref:System.Net.HttpWebRequest.ContentLength%2A> property.|
|Content-Type|Set by the <xref:System.Net.HttpWebRequest.ContentType%2A> property.|
|Expect|Set by the <xref:System.Net.HttpWebRequest.Expect%2A> property.|
|Date|Set by the system to current date.|
|Host|Set by the system to current host information.|
|If-Modified-Since|Set by the <xref:System.Net.HttpWebRequest.IfModifiedSince%2A> property.|
|Range|Set by the <xref:System.Net.HttpWebRequest.AddRange%2A> method.|
|Referer|Set by the <xref:System.Net.HttpWebRequest.Referer%2A> property.|
|Transfer-Encoding|Set by the <xref:System.Net.HttpWebRequest.TransferEncoding%2A> property (the <xref:System.Net.HttpWebRequest.SendChunked%2A> property must be `true`).|
|User-Agent|Set by the <xref:System.Net.HttpWebRequest.UserAgent%2A> property.|
> [!NOTE]
> <xref:System.Net.HttpWebRequest> is registered automatically. You do not need to call the <xref:System.Net.WebRequest.RegisterPrefix%2A> method to register <xref:System.Net.HttpWebRequest?displayProperty=nameWithType> before using URIs beginning with `http://` or `https://`.
The local computer or application config file may specify that a default proxy be used. If the <xref:System.Net.HttpWebRequest.Proxy%2A> property is specified, then the proxy settings from the <xref:System.Net.HttpWebRequest.Proxy%2A> property override the local computer or application config file and the <xref:System.Net.HttpWebRequest> instance will use the proxy settings specified. If no proxy is specified in a config file and the <xref:System.Net.HttpWebRequest.Proxy%2A> property is unspecified, the <xref:System.Net.HttpWebRequest> class uses the proxy settings inherited from Internet Explorer on the local computer. If there are no proxy settings in Internet Explorer, the request is sent directly to the server.
The <xref:System.Net.HttpWebRequest> class parses a proxy bypass list with wildcard characters inherited from Internet Explorer differently than the bypass list is parsed directly by Internet Explorer. For example, the <xref:System.Net.HttpWebRequest> class will parse a bypass list of "nt*" from Internet Explorer as a regular expression of "nt.$". This differs from the native behavior of Internet Explorer. So a URL of "`http://intxxxxx`" would bypass the proxy using the <xref:System.Net.HttpWebRequest> class, but would not bypass the proxy using Internet Explorer.
> [!NOTE]
> The Framework caches SSL sessions as they are created and attempts to reuse a cached session for a new request, if possible. When attempting to reuse an SSL session, the Framework uses the first element of <xref:System.Net.HttpWebRequest.ClientCertificates%2A> (if there is one), or tries to reuse an anonymous sessions if <xref:System.Net.HttpWebRequest.ClientCertificates%2A> is empty.
> [!NOTE]
> For security reasons, cookies are disabled by default. If you want to use cookies, use the <xref:System.Net.HttpWebRequest.CookieContainer%2A> property to enable cookies.
The .NET Framework 4.6 includes a new security feature that blocks insecure cipher and hashing algorithms for connections. Applications using TLS/SSL through APIs such as HttpClient, HttpWebRequest, FTPClient, SmtpClient, SslStream, etc. and targeting .NET Framework 4.6 get the more-secure behavior by default.
Developers may want to opt out of this behavior in order to maintain interoperability with their existing SSL3 services OR TLS w/ RC4 services. [This article](https://support.microsoft.com/kb/3069494) explains how to modify your code so that the new behavior is disabled.
## Examples
The following code example creates an <xref:System.Net.HttpWebRequest> for the URI http://www.contoso.com/.
[!code-cpp[Classic HttpWebRequest Example#1](~/samples/snippets/cpp/VS_Snippets_Remoting/Classic HttpWebRequest Example/CPP/source.cpp#1)]
[!code-csharp[Classic HttpWebRequest Example#1](~/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest Example/CS/source.cs#1)]
[!code-vb[Classic HttpWebRequest Example#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/Classic HttpWebRequest Example/VB/source.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>
<related type="Article" href="https://msdn.microsoft.com/library/9d663c4b-07b4-4f6f-9b12-efbd3630354f">DefaultProxy Element (Network Settings)</related>
<related type="Article" href="https://msdn.microsoft.com/library/8bf0b428-5a21-4299-8d6e-bf8251fd978a">Changes to NTLM authentication for HTTPWebRequest in Version 3.5 SP1</related>
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Net.HttpWebRequest" /> class. These constructors are obsolete; see the Remarks section for details. </summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Both <xref:System.Net.HttpWebRequest> constructors are obsolete and should not be used. Call the <xref:System.Net.WebRequest.CreateHttp%2A?displayProperty=nameWithType> method to initialize new <xref:System.Net.HttpWebRequest> objects.
]]></format>
</remarks>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public HttpWebRequest ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.#ctor" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; HttpWebRequest();" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<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;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;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>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Net.HttpWebRequest" /> class. This constructor is obsolete. </summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public HttpWebRequest (Uri uri);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Uri uri) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.#ctor(System.Uri)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; HttpWebRequest(Uri ^ uri);" />
<MemberSignature Language="F#" Value="new System.Net.HttpWebRequest : Uri -&gt; System.Net.HttpWebRequest" Usage="new System.Net.HttpWebRequest uri" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Parameters>
<Parameter Name="uri" Type="System.Uri" />
</Parameters>
<Docs>
<param name="uri">To be added.</param>
<summary>To be added.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="protected HttpWebRequest (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.HttpWebRequest.#ctor(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; HttpWebRequest(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);" />
<MemberSignature Language="F#" Value="new System.Net.HttpWebRequest : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -&gt; System.Net.HttpWebRequest" Usage="new System.Net.HttpWebRequest (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>
</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="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.Obsolete("Serialization is obsoleted for this type", false)</AttributeName>
</Attribute>
<Attribute FrameworkAlternate="netcore-2.0;netcore-2.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;netstandard-2.0;netframework-4.8">
<AttributeName>System.Obsolete("Serialization is obsoleted for this type. http://go.microsoft.com/fwlink/?linkid=14202")</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="serializationInfo" Type="System.Runtime.Serialization.SerializationInfo" />
<Parameter Name="streamingContext" Type="System.Runtime.Serialization.StreamingContext" />
</Parameters>
<Docs>
<param name="serializationInfo">A <see cref="T:System.Runtime.Serialization.SerializationInfo" /> object that contains the information required to serialize the new <see cref="T:System.Net.HttpWebRequest" /> object.</param>
<param name="streamingContext">A <see cref="T:System.Runtime.Serialization.StreamingContext" /> object that contains the source and destination of the serialized stream associated with the new <see cref="T:System.Net.HttpWebRequest" /> object.</param>
<summary>Initializes a new instance of the <see cref="T:System.Net.HttpWebRequest" /> class from the specified instances of the <see cref="T:System.Runtime.Serialization.SerializationInfo" /> and <see cref="T:System.Runtime.Serialization.StreamingContext" /> classes. This constructor is obsolete. </summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
An application must run in full trust mode when using serialization.
]]></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>
<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 override void Abort ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void Abort() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.Abort" />
<MemberSignature Language="VB.NET" Value="Public Overrides Sub Abort ()" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override void Abort();" />
<MemberSignature Language="F#" Value="override this.Abort : unit -&gt; unit" Usage="httpWebRequest.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>
</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 />
<Docs>
<summary>Cancels a request to an Internet resource.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.Abort%2A> method cancels a request to a resource. After a request is canceled, calling the <xref:System.Net.HttpWebRequest.GetResponse%2A>, <xref:System.Net.HttpWebRequest.BeginGetResponse%2A>, <xref:System.Net.HttpWebRequest.EndGetResponse%2A>, <xref:System.Net.HttpWebRequest.GetRequestStream%2A>, <xref:System.Net.HttpWebRequest.BeginGetRequestStream%2A>, or <xref:System.Net.HttpWebRequest.EndGetRequestStream%2A> method causes a <xref:System.Net.WebException> with the <xref:System.Net.WebException.Status%2A> property set to <xref:System.Net.WebExceptionStatus.RequestCanceled>.
The <xref:System.Net.HttpWebRequest.Abort%2A> method will synchronously execute the callback specified to the <xref:System.Net.HttpWebRequest.BeginGetRequestStream%2A> or <xref:System.Net.HttpWebRequest.BeginGetResponse%2A> methods if the <xref:System.Net.HttpWebRequest.Abort%2A> method is called while either of these operations are outstanding. This can lead to potential deadlock issues.
> [!NOTE]
> This member outputs trace information when you enable network tracing in your application. For more information, see [Network Tracing](https://msdn.microsoft.com/library/e993b7c3-087f-45d8-9c02-9dded936d804).
## Examples
In the case of asynchronous requests, it is the responsibility of the client application to implement its own time-out mechanism. The following code example shows how to do this.
[!code-cpp[System.Net.HttpWebRequest.BeginGetResponse#1](~/samples/snippets/cpp/VS_Snippets_Remoting/System.Net.HttpWebRequest.BeginGetResponse/CPP/begingetresponse.cpp#1)]
[!code-csharp[System.Net.HttpWebRequest.BeginGetResponse#1](~/samples/snippets/csharp/VS_Snippets_Remoting/System.Net.HttpWebRequest.BeginGetResponse/CS/begingetresponse.cs#1)]
[!code-vb[System.Net.HttpWebRequest.BeginGetResponse#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/System.Net.HttpWebRequest.BeginGetResponse/VB/begingetresponse.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Accept">
<MemberSignature Language="C#" Value="public string Accept { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Accept" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.Accept" />
<MemberSignature Language="VB.NET" Value="Public Property Accept As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Accept { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Accept : string with get, set" Usage="System.Net.HttpWebRequest.Accept" />
<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>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Attributes>
<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.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the value of the <see langword="Accept" /> HTTP header.</summary>
<value>The value of the <see langword="Accept" /> HTTP header. The default value is <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
To clear the `Accept` HTTP header, set the <xref:System.Net.HttpWebRequest.Accept%2A> property to `null`.
> [!NOTE]
> The value for this property is stored in <xref:System.Net.WebHeaderCollection>. If WebHeaderCollection is set, the property value is lost.
## Examples
The following code example sets the <xref:System.Net.HttpWebRequest.Accept%2A> property.
[!code-cpp[HttpWebRequest_Accept#1](~/samples/snippets/cpp/VS_Snippets_Remoting/HttpWebRequest_Accept/CPP/httpwebrequest_accept.cpp#1)]
[!code-csharp[HttpWebRequest_Accept#1](~/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Accept/CS/httpwebrequest_accept.cs#1)]
[!code-vb[HttpWebRequest_Accept#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/HttpWebRequest_Accept/VB/httpwebrequest_accept.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<MemberGroup MemberName="AddRange">
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Adds a range header to the request.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Since all HTTP entities are represented in HTTP messages as sequences of bytes, the concept of a byte range is meaningful for any HTTP entity. However, not all clients and servers need to support byte-range operations.
The Range header on a request allows a client to request that it only wants to receive some part of the specified range of bytes in an HTTP entity. Servers are not required to support Range header requests.
]]></format>
</remarks>
</Docs>
</MemberGroup>
<Member MemberName="AddRange">
<MemberSignature Language="C#" Value="public void AddRange (int range);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddRange(int32 range) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.AddRange(System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddRange (range As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddRange(int range);" />
<MemberSignature Language="F#" Value="member this.AddRange : int -&gt; unit" Usage="httpWebRequest.AddRange range" />
<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>
</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="range" Type="System.Int32" />
</Parameters>
<Docs>
<param name="range">The starting or ending point of the range.</param>
<summary>Adds a byte range header to a request for a specific range from the beginning or end of the requested data.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.AddRange%2A?displayProperty=nameWithType> method adds a byte range header to the request.
If `range` is positive, the `range` parameter specifies the starting point of the range. The server should start sending data from the `range` parameter specified to the end of the data in the HTTP entity.
If `range` is negative, the `range` parameter specifies the ending point of the range. The server should start sending data from the start of the data in the HTTP entity to the `range` parameter specified.
Since all HTTP entities are represented in HTTP messages as sequences of bytes, the concept of a byte range is meaningful for any HTTP entity. However, not all clients and servers need to support byte-range operations.
The Range header on a request allows a client to request that it only wants to receive some part of the specified range of bytes in an HTTP entity. Servers are not required to support Range header requests.
An example of a Range header in an HTTP protocol request that requests the server send the first 100 bytes (from the start to byte position 99) would be the following:
`Range: bytes=0-99\r\n\r\n`
For this example, the `range` parameter would be -99.
A HTTP server indicates support for Range headers with the Accept-Ranges header. An example of the Accept-Ranges header from a server that supports byte-ranges would be as follows:
`Accept-Ranges: bytes\r\n\r\n`
If an Accept-Ranges header is not received in the header of the response from the server, then the server does not support Range headers. An example of the Accept-Ranges header from a server that does not support ranges, but recognizes the Accept-Ranges header, would be as follows:
`Accept-Ranges: none\r\n\r\n`
When receiving the response from a range request, only the HTTP headers associated with the entire request are parsed and made available via properties on the <xref:System.Net.HttpWebResponse> class. Headers associated with each range are returned in the response.
## Examples
The following code example adds a range header to the request.
[!code-cpp[System.Net.HttpWebRequest.AddRange#1](~/samples/snippets/cpp/VS_Snippets_Misc/system.net.httpwebrequest.addrange/cpp/source.cpp#1)]
[!code-csharp[System.Net.HttpWebRequest.AddRange#1](~/samples/snippets/csharp/VS_Snippets_Misc/system.net.httpwebrequest.addrange/cs/source.cs#1)]
[!code-vb[System.Net.HttpWebRequest.AddRange#1](~/samples/snippets/visualbasic/VS_Snippets_Misc/system.net.httpwebrequest.addrange/vb/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="rangeSpecifier" /> is invalid.</exception>
<exception cref="T:System.InvalidOperationException">The range header could not be added.</exception>
<altmember cref="Overload:System.Net.HttpWebRequest.AddRange" />
</Docs>
</Member>
<Member MemberName="AddRange">
<MemberSignature Language="C#" Value="public void AddRange (long range);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddRange(int64 range) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.AddRange(System.Int64)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddRange (range As Long)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddRange(long range);" />
<MemberSignature Language="F#" Value="member this.AddRange : int64 -&gt; unit" Usage="httpWebRequest.AddRange range" />
<MemberType>Method</MemberType>
<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>
</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="range" Type="System.Int64" />
</Parameters>
<Docs>
<param name="range">The starting or ending point of the range.</param>
<summary>Adds a byte range header to a request for a specific range from the beginning or end of the requested data.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.AddRange%2A?displayProperty=nameWithType> method adds a byte range header to the request.
If `range` is positive, the `range` parameter specifies the starting point of the range. The server should start sending data from the `range` parameter specified to the end of the data in the HTTP entity.
If `range` is negative, the `range` parameter specifies the ending point of the range. The server should start sending data from the start of the data in the HTTP entity to the `range` parameter specified.
Since all HTTP entities are represented in HTTP messages as sequences of bytes, the concept of a byte range is meaningful for any HTTP entity. However, not all clients and servers need to support byte-range operations.
The Range header on a request allows a client to request that it only wants to receive some part of the specified range of bytes in an HTTP entity. Servers are not required to support Range header requests.
An example of a Range header in an HTTP protocol request that requests the server send the first 100 bytes (from the start to byte position 99) would be the following:
`Range: bytes=0-99\r\n\r\n`
For this example, the `range` parameter would be -99.
A HTTP server indicates support for Range headers with the Accept-Ranges header. An example of the Accept-Ranges header from a server that supports byte-ranges would be as follows:
`Accept-Ranges: bytes\r\n\r\n`
If an Accept-Ranges header is not received in the header of the response from the server, then the server does not support Range headers. An example of the Accept-Ranges header from a server that does not support ranges, but recognizes the Accept-Ranges header, would be as follows:
`Accept-Ranges: none\r\n\r\n`
When receiving the response from a range request, only the HTTP headers associated with the entire request are parsed and made available via properties on the <xref:System.Net.HttpWebResponse> class. Headers associated with each range are returned in the response.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="rangeSpecifier" /> is invalid.</exception>
<exception cref="T:System.InvalidOperationException">The range header could not be added.</exception>
<altmember cref="Overload:System.Net.HttpWebRequest.AddRange" />
</Docs>
</Member>
<Member MemberName="AddRange">
<MemberSignature Language="C#" Value="public void AddRange (int from, int to);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddRange(int32 from, int32 to) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.AddRange(System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddRange (from As Integer, to As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddRange(int from, int to);" />
<MemberSignature Language="F#" Value="member this.AddRange : int * int -&gt; unit" Usage="httpWebRequest.AddRange (from, to)" />
<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>
</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="from" Type="System.Int32" />
<Parameter Name="to" Type="System.Int32" />
</Parameters>
<Docs>
<param name="from">The position at which to start sending data.</param>
<param name="to">The position at which to stop sending data.</param>
<summary>Adds a byte range header to the request for a specified range.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.AddRange%2A?displayProperty=nameWithType> method adds a byte range header to the request.
Since all HTTP entities are represented in HTTP messages as sequences of bytes, the concept of a byte range is meaningful for any HTTP entity. However, not all clients and servers need to support byte-range operations.
The Range header on a request allows a client to request that it only wants to receive some part of the specified range of bytes in an HTTP entity. Servers are not required to support Range header requests.
An example of a Range header in an HTTP protocol request that requests the first 100 bytes would be would be the following:
`Range: bytes=0-99\r\n\r\n`
For this example, the `from` parameter would be specified as 0 and the `to` parameter would be specified as 99. The range specifier is automatically set as "bytes" by this method.
A HTTP server indicates support for Range headers with the Accept-Ranges header. An example of the Accept-Ranges header from a server that supports byte-ranges would be as follows:
`Accept-Ranges: bytes\r\n\r\n`
If an Accept-Ranges header is not received in the header of the response from the server, then the server does not support Range headers. An example of the Accept-Ranges header from a server that does not support ranges, but recognizes the Accept-Ranges header, would be as follows:
`Accept-Ranges: none\r\n\r\n`
When receiving the response from a range request, only the HTTP headers associated with the entire request are parsed and made available via properties on the <xref:System.Net.HttpWebResponse> class. Headers associated with each range are returned in the response.
## Examples
The following code example adds a range header to the request.
[!code-cpp[System.Net.HttpWebRequest.AddRange2#1](~/samples/snippets/cpp/VS_Snippets_Misc/system.net.httpwebrequest.addrange2/cpp/source.cpp#1)]
[!code-csharp[System.Net.HttpWebRequest.AddRange2#1](~/samples/snippets/csharp/VS_Snippets_Misc/system.net.httpwebrequest.addrange2/cs/source.cs#1)]
[!code-vb[System.Net.HttpWebRequest.AddRange2#1](~/samples/snippets/visualbasic/VS_Snippets_Misc/system.net.httpwebrequest.addrange2/vb/source.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="rangeSpecifier" /> is invalid.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="from" /> is greater than <paramref name="to" />
-or-
<paramref name="from" /> or <paramref name="to" /> is less than 0.</exception>
<exception cref="T:System.InvalidOperationException">The range header could not be added.</exception>
<altmember cref="Overload:System.Net.HttpWebRequest.AddRange" />
</Docs>
</Member>
<Member MemberName="AddRange">
<MemberSignature Language="C#" Value="public void AddRange (long from, long to);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddRange(int64 from, int64 to) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.AddRange(System.Int64,System.Int64)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddRange (from As Long, to As Long)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddRange(long from, long to);" />
<MemberSignature Language="F#" Value="member this.AddRange : int64 * int64 -&gt; unit" Usage="httpWebRequest.AddRange (from, to)" />
<MemberType>Method</MemberType>
<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>
</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="from" Type="System.Int64" />
<Parameter Name="to" Type="System.Int64" />
</Parameters>
<Docs>
<param name="from">The position at which to start sending data.</param>
<param name="to">The position at which to stop sending data.</param>
<summary>Adds a byte range header to the request for a specified range.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.AddRange%2A?displayProperty=nameWithType> method adds a byte range header to the request.
Since all HTTP entities are represented in HTTP messages as sequences of bytes, the concept of a byte range is meaningful for any HTTP entity. However, not all clients and servers need to support byte-range operations.
The Range header on a request allows a client to request that it only wants to receive some part of the specified range of bytes in an HTTP entity. Servers are not required to support Range header requests.
An example of a Range header in an HTTP protocol request that requests the first 100 bytes would be would be the following:
`Range: bytes=0-99\r\n\r\n`
For this example, the `from` parameter would be specified as 0 and the `to` parameter would be specified as 99. The range specifier is automatically set as "bytes" by this method.
A HTTP server indicates support for Range headers with the Accept-Ranges header. An example of the Accept-Ranges header from a server that supports byte-ranges would be as follows:
`Accept-Ranges: bytes\r\n\r\n`
If an Accept-Ranges header is not received in the header of the response from the server, then the server does not support Range headers. An example of the Accept-Ranges header from a server that does not support ranges, but recognizes the Accept-Ranges header, would be as follows:
`Accept-Ranges: none\r\n\r\n`
When receiving the response from a range request, only the HTTP headers associated with the entire request are parsed and made available via properties on the <xref:System.Net.HttpWebResponse> class. Headers associated with each range are returned in the response.
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="rangeSpecifier" /> is invalid.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="from" /> is greater than <paramref name="to" />
-or-
<paramref name="from" /> or <paramref name="to" /> is less than 0.</exception>
<exception cref="T:System.InvalidOperationException">The range header could not be added.</exception>
<altmember cref="Overload:System.Net.HttpWebRequest.AddRange" />
</Docs>
</Member>
<Member MemberName="AddRange">
<MemberSignature Language="C#" Value="public void AddRange (string rangeSpecifier, int range);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddRange(string rangeSpecifier, int32 range) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.AddRange(System.String,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddRange (rangeSpecifier As String, range As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddRange(System::String ^ rangeSpecifier, int range);" />
<MemberSignature Language="F#" Value="member this.AddRange : string * int -&gt; unit" Usage="httpWebRequest.AddRange (rangeSpecifier, range)" />
<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>
</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="rangeSpecifier" Type="System.String" />
<Parameter Name="range" Type="System.Int32" />
</Parameters>
<Docs>
<param name="rangeSpecifier">The description of the range.</param>
<param name="range">The starting or ending point of the range.</param>
<summary>Adds a Range header to a request for a specific range from the beginning or end of the requested data.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.AddRange%2A?displayProperty=nameWithType> method adds a Range header to the request.
If `range` is positive, the `range` parameter specifies the starting point of the range. The server should start sending data from the `range` parameter specified to the end of the data in the HTTP entity.
If `range` is negative, the `range` parameter specifies the ending point of the range. The server should start sending data from the start of the data in the HTTP entity to the `range` parameter specified.
Since all HTTP entities are represented in HTTP messages as sequences of bytes, the concept of a byte range is meaningful for any HTTP entity. However, not all clients and servers need to support byte-range operations.
The Range header on a request allows a client to request that it only wants to receive some part of the specified range of bytes in an HTTP entity. Servers are not required to support Range header requests.
The `rangeSpecifier` parameter would normally be specified as a "bytes", since this is the only range specifier recognized by most HTTP servers. Setting the `rangeSpecifier` parameter to some other string allows support for custom range specifiers other than bytes (the byte-range specifier defined in RFC 2616 by the IETF).
An example of a Range header in an HTTP protocol request that requests the first 100 bytes would be would be the following:
`Range: bytes=-99\r\n\r\n`
For this example, the `rangeSpecifier` parameter would be specified as "bytes" and the `range` parameter would be -99.
A HTTP server indicates support for Range headers with the Accept-Ranges header in the response. An example of the Accept-Ranges header from a server that supports byte-ranges would be as follows:
`Accept-Ranges: bytes\r\n\r\n`
If an Accept-Ranges header is not received in the header of the response from the server, then the server does not support Range headers. An example of the Accept-Ranges header from a server that does not support ranges, but recognizes the Accept-Ranges header, would be as follows:
`Accept-Ranges: none\r\n\r\n`
When receiving the response from a range request, only the HTTP headers associated with the entire request are parsed and made available via properties on the <xref:System.Net.HttpWebResponse> class. Headers associated with each range are returned in the response.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="rangeSpecifier" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="rangeSpecifier" /> is invalid.</exception>
<exception cref="T:System.InvalidOperationException">The range header could not be added.</exception>
<altmember cref="Overload:System.Net.HttpWebRequest.AddRange" />
</Docs>
</Member>
<Member MemberName="AddRange">
<MemberSignature Language="C#" Value="public void AddRange (string rangeSpecifier, long range);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddRange(string rangeSpecifier, int64 range) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.AddRange(System.String,System.Int64)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddRange (rangeSpecifier As String, range As Long)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddRange(System::String ^ rangeSpecifier, long range);" />
<MemberSignature Language="F#" Value="member this.AddRange : string * int64 -&gt; unit" Usage="httpWebRequest.AddRange (rangeSpecifier, range)" />
<MemberType>Method</MemberType>
<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>
</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="rangeSpecifier" Type="System.String" />
<Parameter Name="range" Type="System.Int64" />
</Parameters>
<Docs>
<param name="rangeSpecifier">The description of the range.</param>
<param name="range">The starting or ending point of the range.</param>
<summary>Adds a Range header to a request for a specific range from the beginning or end of the requested data.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.AddRange%2A?displayProperty=nameWithType> method adds a Range header to the request.
If `range` is positive, the `range` parameter specifies the starting point of the range. The server should start sending data from the `range` parameter specified to the end of the data in the HTTP entity.
If `range` is negative, the `range` parameter specifies the ending point of the range. The server should start sending data from the start of the data in the HTTP entity to the `range` parameter specified.
Since all HTTP entities are represented in HTTP messages as sequences of bytes, the concept of a byte range is meaningful for any HTTP entity. However, not all clients and servers need to support byte-range operations.
The Range header on a request allows a client to request that it only wants to receive some part of the specified range of bytes in an HTTP entity. Servers are not required to support Range header requests.
The `rangeSpecifier` parameter would normally be specified as a "bytes", since this is the only range specifier recognized by most HTTP servers. Setting the `rangeSpecifier` parameter to some other string allows support for custom range specifiers other than bytes (the byte-range specifier defined in RFC 2616 by the IETF).
An example of a Range header in an HTTP protocol request that requests the first 100 bytes would be would be the following:
`Range: bytes=-99\r\n\r\n`
For this example, the `rangeSpecifier` parameter would be specified as "bytes" and the `range` parameter would be -99.
A HTTP server indicates support for Range headers with the Accept-Ranges header in the response. An example of the Accept-Ranges header from a server that supports byte-ranges would be as follows:
`Accept-Ranges: bytes\r\n\r\n`
If an Accept-Ranges header is not received in the header of the response from the server, then the server does not support Range headers. An example of the Accept-Ranges header from a server that does not support ranges, but recognizes the Accept-Ranges header, would be as follows:
`Accept-Ranges: none\r\n\r\n`
When receiving the response from a range request, only the HTTP headers associated with the entire request are parsed and made available via properties on the <xref:System.Net.HttpWebResponse> class. Headers associated with each range are returned in the response.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="rangeSpecifier" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="rangeSpecifier" /> is invalid.</exception>
<exception cref="T:System.InvalidOperationException">The range header could not be added.</exception>
<altmember cref="Overload:System.Net.HttpWebRequest.AddRange" />
</Docs>
</Member>
<Member MemberName="AddRange">
<MemberSignature Language="C#" Value="public void AddRange (string rangeSpecifier, int from, int to);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddRange(string rangeSpecifier, int32 from, int32 to) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.AddRange(System.String,System.Int32,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddRange (rangeSpecifier As String, from As Integer, to As Integer)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddRange(System::String ^ rangeSpecifier, int from, int to);" />
<MemberSignature Language="F#" Value="member this.AddRange : string * int * int -&gt; unit" Usage="httpWebRequest.AddRange (rangeSpecifier, from, to)" />
<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>
</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="rangeSpecifier" Type="System.String" />
<Parameter Name="from" Type="System.Int32" />
<Parameter Name="to" Type="System.Int32" />
</Parameters>
<Docs>
<param name="rangeSpecifier">The description of the range.</param>
<param name="from">The position at which to start sending data.</param>
<param name="to">The position at which to stop sending data.</param>
<summary>Adds a range header to a request for a specified range.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.AddRange%2A?displayProperty=nameWithType> method adds a Range header to the request.
Since all HTTP entities are represented in HTTP messages as sequences of bytes, the concept of a byte range is meaningful for any HTTP entity. However, not all clients and servers need to support byte-range operations.
The Range header on a request allows a client to request that it only wants to receive some part of the specified range of bytes in an HTTP entity. Servers are not required to support Range header requests.
The `rangeSpecifier` parameter would normally be specified as a "bytes", since this is the only range specifier recognized by most HTTP servers. Setting the `rangeSpecifier` parameter to some other string allows support for custom range specifiers other than bytes (the byte-range specifier defined in RFC 2616 by the IETF).
An example of a Range header in an HTTP protocol request that requests the first 100 bytes would be would be the following:
`Range: bytes=0-99\r\n\r\n`
For this example, the `rangeSpecifier` parameter would be specified as a "bytes", the `from` parameter would be 0, and the `to` parameter would be 99.
A HTTP server indicates support for Range headers with the Accept-Ranges header in the response. An example of the Accept-Ranges header from a server that supports byte-ranges would be as follows:
`Accept-Ranges: bytes\r\n\r\n`
The string specified in the Accept-Ranges header is the range-specifier that would be by specified in the `rangeSpecifier` parameter for this method.
If an Accept-Ranges header is not received in the header of the response from the server, then the server does not support Range headers. An example of the Accept-Ranges header from a server that does not support ranges, but recognizes the Accept-Ranges header, would be as follows:
`Accept-Ranges: none\r\n\r\n`
When receiving the response from a range request, only the HTTP headers associated with the entire request are parsed and made available via properties on the <xref:System.Net.HttpWebResponse> class. Headers associated with each range are returned in the response.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="rangeSpecifier" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="from" /> is greater than <paramref name="to" />
-or-
<paramref name="from" /> or <paramref name="to" /> is less than 0.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="rangeSpecifier" /> is invalid.</exception>
<exception cref="T:System.InvalidOperationException">The range header could not be added.</exception>
<altmember cref="Overload:System.Net.HttpWebRequest.AddRange" />
</Docs>
</Member>
<Member MemberName="AddRange">
<MemberSignature Language="C#" Value="public void AddRange (string rangeSpecifier, long from, long to);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void AddRange(string rangeSpecifier, int64 from, int64 to) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.AddRange(System.String,System.Int64,System.Int64)" />
<MemberSignature Language="VB.NET" Value="Public Sub AddRange (rangeSpecifier As String, from As Long, to As Long)" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; void AddRange(System::String ^ rangeSpecifier, long from, long to);" />
<MemberSignature Language="F#" Value="member this.AddRange : string * int64 * int64 -&gt; unit" Usage="httpWebRequest.AddRange (rangeSpecifier, from, to)" />
<MemberType>Method</MemberType>
<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>
</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="rangeSpecifier" Type="System.String" />
<Parameter Name="from" Type="System.Int64" />
<Parameter Name="to" Type="System.Int64" />
</Parameters>
<Docs>
<param name="rangeSpecifier">The description of the range.</param>
<param name="from">The position at which to start sending data.</param>
<param name="to">The position at which to stop sending data.</param>
<summary>Adds a range header to a request for a specified range.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.AddRange%2A?displayProperty=nameWithType> method adds a Range header to the request.
Since all HTTP entities are represented in HTTP messages as sequences of bytes, the concept of a byte range is meaningful for any HTTP entity. However, not all clients and servers need to support byte-range operations.
The Range header on a request allows a client to request that it only wants to receive some part of the specified range of bytes in an HTTP entity. Servers are not required to support Range header requests.
The `rangeSpecifier` parameter would normally be specified as a "bytes", since this is the only range specifier recognized by most HTTP servers. Setting the `rangeSpecifier` parameter to some other string allows support for custom range specifiers other than bytes (the byte-range specifier defined in RFC 2616 by the IETF).
An example of a Range header in an HTTP protocol request that requests the first 100 bytes would be would be the following:
`Range: bytes=0-99\r\n\r\n`
For this example, the `rangeSpecifier` parameter would be specified as a "bytes", the `from` parameter would be 0, and the `to` parameter would be 99.
A HTTP server indicates support for Range headers with the Accept-Ranges header in the response. An example of the Accept-Ranges header from a server that supports byte-ranges would be as follows:
`Accept-Ranges: bytes\r\n\r\n`
The string specified in the Accept-Ranges header is the range-specifier that would be by specified in the `rangeSpecifier` parameter for this method.
If an Accept-Ranges header is not received in the header of the response from the server, then the server does not support Range headers. An example of the Accept-Ranges header from a server that does not support ranges, but recognizes the Accept-Ranges header, would be as follows:
`Accept-Ranges: none\r\n\r\n`
When receiving the response from a range request, only the HTTP headers associated with the entire request are parsed and made available via properties on the <xref:System.Net.HttpWebResponse> class. Headers associated with each range are returned in the response.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="rangeSpecifier" /> is <see langword="null" />.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">
<paramref name="from" /> is greater than <paramref name="to" />
-or-
<paramref name="from" /> or <paramref name="to" /> is less than 0.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="rangeSpecifier" /> is invalid.</exception>
<exception cref="T:System.InvalidOperationException">The range header could not be added.</exception>
<altmember cref="Overload:System.Net.HttpWebRequest.AddRange" />
</Docs>
</Member>
<Member MemberName="Address">
<MemberSignature Language="C#" Value="public Uri Address { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Uri Address" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.Address" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Address As Uri" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property Uri ^ Address { Uri ^ get(); };" />
<MemberSignature Language="F#" Value="member this.Address : Uri" Usage="System.Net.HttpWebRequest.Address" />
<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>
</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>
</Attributes>
<ReturnValue>
<ReturnType>System.Uri</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets the Uniform Resource Identifier (URI) of the Internet resource that actually responds to the request.</summary>
<value>A <see cref="T:System.Uri" /> that identifies the Internet resource that actually responds to the request. The default is the URI used by the <see cref="M:System.Net.WebRequest.Create(System.String)" /> method to initialize the request.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.Address%2A> property is set to the URI after any redirections that happen during the request are complete.
The URI of the original request is kept in the <xref:System.Net.HttpWebRequest.RequestUri%2A> property.
## Examples
The following code example checks to see if the <xref:System.Net.HttpWebRequest> object `req` was redirected to another location to fulfill the request, and sets the value of the `hasChanged` variable to `true` if the request was redirected; otherwise `hasChanged` is set to `false`.
[!code-cpp[Classic HttpWebRequest.RequestUri Example#1](~/samples/snippets/cpp/VS_Snippets_Remoting/Classic HttpWebRequest.RequestUri Example/CPP/source.cpp#1)]
[!code-csharp[Classic HttpWebRequest.RequestUri Example#1](~/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest.RequestUri Example/CS/source.cs#1)]
[!code-vb[Classic HttpWebRequest.RequestUri Example#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/Classic HttpWebRequest.RequestUri Example/VB/source.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="AllowAutoRedirect">
<MemberSignature Language="C#" Value="public virtual bool AllowAutoRedirect { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AllowAutoRedirect" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.AllowAutoRedirect" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property AllowAutoRedirect As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool AllowAutoRedirect { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AllowAutoRedirect : bool with get, set" Usage="System.Net.HttpWebRequest.AllowAutoRedirect" />
<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>
</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>Gets or sets a value that indicates whether the request should follow redirection responses.</summary>
<value>
<see langword="true" /> if the request should automatically follow redirection responses from the Internet resource; otherwise, <see langword="false" />. The default value is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Set <xref:System.Net.HttpWebRequest.AllowAutoRedirect%2A> to `true` if you want the request to automatically follow HTTP redirection headers to the new location of the resource. The maximum number of redirections to follow is set by the <xref:System.Net.HttpWebRequest.MaximumAutomaticRedirections%2A> property.
If <xref:System.Net.HttpWebRequest.AllowAutoRedirect%2A> is set to `false`, all responses with an HTTP status code from 300 to 399 is returned to the application.
The Authorization header is cleared on auto-redirects and <xref:System.Net.HttpWebRequest> automatically tries to re-authenticate to the redirected location. In practice, this means that an application can't put custom authentication information into the Authorization header if it is possible to encounter redirection. Instead, the application must implement and register a custom authentication module. The <xref:System.Net.AuthenticationManager?displayProperty=nameWithType> and related class are used to implement a custom authentication module. The <xref:System.Net.AuthenticationManager.Register%2A?displayProperty=nameWithType> method registers a custom authentication module.
## Examples
The following code example uses the <xref:System.Net.HttpWebRequest.AllowAutoRedirect%2A> property to allow the request to follow redirection responses.
[!code-cpp[HttpWebRequest_AllowAutoRedirect#2](~/samples/snippets/cpp/VS_Snippets_Remoting/HttpWebRequest_AllowAutoRedirect/CPP/httpwebrequest_allowautoredirect.cpp#2)]
[!code-csharp[HttpWebRequest_AllowAutoRedirect#2](~/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_AllowAutoRedirect/CS/httpwebrequest_allowautoredirect.cs#2)]
[!code-vb[HttpWebRequest_AllowAutoRedirect#2](~/samples/snippets/visualbasic/VS_Snippets_Remoting/HttpWebRequest_AllowAutoRedirect/VB/httpwebrequest_allowautoredirect.vb#2)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="AllowReadStreamBuffering">
<MemberSignature Language="C#" Value="public virtual bool AllowReadStreamBuffering { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AllowReadStreamBuffering" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.AllowReadStreamBuffering" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property AllowReadStreamBuffering As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool AllowReadStreamBuffering { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AllowReadStreamBuffering : bool with get, set" Usage="System.Net.HttpWebRequest.AllowReadStreamBuffering" />
<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.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value that indicates whether to buffer the received from the Internet resource.</summary>
<value>
<see langword="true" /> to enable buffering of the data received from the Internet resource; <see langword="false" /> to disable buffering. The default is <see langword="false" />.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="AllowWriteStreamBuffering">
<MemberSignature Language="C#" Value="public virtual bool AllowWriteStreamBuffering { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool AllowWriteStreamBuffering" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.AllowWriteStreamBuffering" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property AllowWriteStreamBuffering As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool AllowWriteStreamBuffering { bool get(); void set(bool value); };" />
<MemberSignature Language="F#" Value="member this.AllowWriteStreamBuffering : bool with get, set" Usage="System.Net.HttpWebRequest.AllowWriteStreamBuffering" />
<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>
</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>Gets or sets a value that indicates whether to buffer the data sent to the Internet resource.</summary>
<value>
<see langword="true" /> to enable buffering of the data sent to the Internet resource; <see langword="false" /> to disable buffering. The default is <see langword="true" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When <xref:System.Net.HttpWebRequest.AllowWriteStreamBuffering%2A> is `true`, the data is buffered in memory so it is ready to be resent in the event of redirections or authentication requests.
## Examples
The following code example uses the <xref:System.Net.HttpWebRequest.AllowWriteStreamBuffering%2A> property to disable data buffering.
[!code-cpp[HttpWebRequest_AllowWriteStreamBuffering#1](~/samples/snippets/cpp/VS_Snippets_Remoting/HttpWebRequest_AllowWriteStreamBuffering/CPP/httpwebrequest_allowwritestreambuffering.cpp#1)]
[!code-csharp[HttpWebRequest_AllowWriteStreamBuffering#1](~/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_AllowWriteStreamBuffering/CS/httpwebrequest_allowwritestreambuffering.cs#1)]
[!code-vb[HttpWebRequest_AllowWriteStreamBuffering#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/HttpWebRequest_AllowWriteStreamBuffering/VB/httpwebrequest_allowwritestreambuffering.vb#1)]
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>Setting <see cref="P:System.Net.HttpWebRequest.AllowWriteStreamBuffering" /> to <see langword="true" /> might cause performance problems when uploading large datasets because the data buffer could use all available memory.</para>
</block>
</Docs>
</Member>
<Member MemberName="AutomaticDecompression">
<MemberSignature Language="C#" Value="public System.Net.DecompressionMethods AutomaticDecompression { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.Net.DecompressionMethods AutomaticDecompression" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.AutomaticDecompression" />
<MemberSignature Language="VB.NET" Value="Public Property AutomaticDecompression As DecompressionMethods" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Net::DecompressionMethods AutomaticDecompression { System::Net::DecompressionMethods get(); void set(System::Net::DecompressionMethods value); };" />
<MemberSignature Language="F#" Value="member this.AutomaticDecompression : System.Net.DecompressionMethods with get, set" Usage="System.Net.HttpWebRequest.AutomaticDecompression" />
<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>
</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>
</Attributes>
<ReturnValue>
<ReturnType>System.Net.DecompressionMethods</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the type of decompression that is used.</summary>
<value>A <see cref="T:System.Net.DecompressionMethods" /> object that indicates the type of decompression that is used.</value>
<remarks>To be added.</remarks>
<exception cref="T:System.InvalidOperationException">The object's current state does not allow this property to be set.</exception>
</Docs>
</Member>
<Member MemberName="BeginGetRequestStream">
<MemberSignature Language="C#" Value="public override IAsyncResult BeginGetRequestStream (AsyncCallback callback, object state);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.IAsyncResult BeginGetRequestStream(class System.AsyncCallback callback, object state) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.BeginGetRequestStream(System.AsyncCallback,System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function BeginGetRequestStream (callback As AsyncCallback, state As Object) As IAsyncResult" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override IAsyncResult ^ BeginGetRequestStream(AsyncCallback ^ callback, System::Object ^ state);" />
<MemberSignature Language="F#" Value="override this.BeginGetRequestStream : AsyncCallback * obj -&gt; IAsyncResult" Usage="httpWebRequest.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>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="callback" Type="System.AsyncCallback" />
<Parameter Name="state" Type="System.Object" />
</Parameters>
<Docs>
<param name="callback">The <see cref="T:System.AsyncCallback" /> delegate.</param>
<param name="state">The state object for this request.</param>
<summary>Begins an asynchronous request for a <see cref="T:System.IO.Stream" /> object to use to write data.</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.HttpWebRequest.BeginGetRequestStream%2A> method starts an asynchronous request for a stream used to send data for the <xref:System.Net.HttpWebRequest>. The asynchronous callback method uses the <xref:System.Net.HttpWebRequest.EndGetRequestStream%2A> method to return the actual stream.
The <xref:System.Net.HttpWebRequest.BeginGetRequestStream%2A> method requires some synchronous setup tasks to complete (DNS resolution, proxy detection, and TCP socket connection, for example) before this method becomes asynchronous. As a result, this method should never be called on a user interface (UI) thread because it might take considerable time (up to several minutes depending on network settings) to complete the initial synchronous setup tasks before an exception for an error is thrown or the method succeeds.
To learn more about the thread pool, see [The managed thread pool](~/docs/standard/threading/the-managed-thread-pool.md).
> [!NOTE]
> Your application cannot mix synchronous and asynchronous methods for a particular request. If you call the <xref:System.Net.HttpWebRequest.BeginGetRequestStream%2A> method, you must use the <xref:System.Net.HttpWebRequest.BeginGetResponse%2A> method to retrieve the response.
> [!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 code example uses the <xref:System.Net.HttpWebRequest.BeginGetRequestStream%2A> method to make an asynchronous request for a stream instance.
[!code-cpp[HttpWebRequest_BeginGetRequestStream#2](~/samples/snippets/cpp/VS_Snippets_Remoting/HttpWebRequest_BeginGetRequestStream/CPP/httpwebrequest_begingetrequeststream.cpp#2)]
[!code-csharp[HttpWebRequest_BeginGetRequestStream#2](~/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_BeginGetRequestStream/CS/httpwebrequest_begingetrequeststream.cs#2)]
[!code-vb[HttpWebRequest_BeginGetRequestStream#2](~/samples/snippets/visualbasic/VS_Snippets_Remoting/HttpWebRequest_BeginGetRequestStream/VB/httpwebrequest_begingetrequeststream.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.Net.ProtocolViolationException">The <see cref="P:System.Net.HttpWebRequest.Method" /> property is GET or HEAD.
-or-
<see cref="P:System.Net.HttpWebRequest.KeepAlive" /> is <see langword="true" />, <see cref="P:System.Net.HttpWebRequest.AllowWriteStreamBuffering" /> is <see langword="false" />, <see cref="P:System.Net.HttpWebRequest.ContentLength" /> is -1, <see cref="P:System.Net.HttpWebRequest.SendChunked" /> is <see langword="false" />, and <see cref="P:System.Net.HttpWebRequest.Method" /> is POST or PUT.</exception>
<exception cref="T:System.InvalidOperationException">The stream is being used by a previous call to <see cref="M:System.Net.HttpWebRequest.BeginGetRequestStream(System.AsyncCallback,System.Object)" />
-or-
<see cref="P:System.Net.HttpWebRequest.TransferEncoding" /> is set to a value and <see cref="P:System.Net.HttpWebRequest.SendChunked" /> is <see langword="false" />.
-or-
The thread pool is running out of threads.</exception>
<exception cref="T:System.NotSupportedException">The request cache validator indicated that the response for this request can be served from the cache; however, requests that write data must not use the cache. This exception can occur if you are using a custom cache validator that is incorrectly implemented.</exception>
<exception cref="T:System.Net.WebException">
<see cref="M:System.Net.HttpWebRequest.Abort" /> was previously called.</exception>
<exception cref="T:System.ObjectDisposedException">In a .NET Compact Framework application, a request stream with zero content length was not obtained and closed correctly. For more information about handling zero content length requests, see [Network Programming in the .NET Compact Framework](https://msdn.microsoft.com/subscriptions/downloads/1afx2b0f\(v=vs.80\).aspx).</exception>
<related type="Article" href="https://msdn.microsoft.com/library/9d663c4b-07b4-4f6f-9b12-efbd3630354f">DefaultProxy Element (Network Settings)</related>
</Docs>
</Member>
<Member MemberName="BeginGetResponse">
<MemberSignature Language="C#" Value="public override IAsyncResult BeginGetResponse (AsyncCallback callback, object state);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.IAsyncResult BeginGetResponse(class System.AsyncCallback callback, object state) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback,System.Object)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function BeginGetResponse (callback As AsyncCallback, state As Object) As IAsyncResult" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override IAsyncResult ^ BeginGetResponse(AsyncCallback ^ callback, System::Object ^ state);" />
<MemberSignature Language="F#" Value="override this.BeginGetResponse : AsyncCallback * obj -&gt; IAsyncResult" Usage="httpWebRequest.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>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IAsyncResult</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="callback" Type="System.AsyncCallback" />
<Parameter Name="state" Type="System.Object" />
</Parameters>
<Docs>
<param name="callback">The <see cref="T:System.AsyncCallback" /> delegate</param>
<param name="state">The state object for this request.</param>
<summary>Begins an asynchronous request to an Internet resource.</summary>
<returns>An <see cref="T:System.IAsyncResult" /> that references the asynchronous request for a response.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.BeginGetResponse%2A> method starts an asynchronous request for a response from the Internet resource. The asynchronous callback method uses the <xref:System.Net.HttpWebRequest.EndGetResponse%2A> method to return the actual <xref:System.Net.WebResponse>.
A <xref:System.Net.ProtocolViolationException> is thrown in several cases when the properties set on the <xref:System.Net.HttpWebRequest> class are conflicting. This exception occurs if an application sets the <xref:System.Net.HttpWebRequest.ContentLength%2A> property and the <xref:System.Net.HttpWebRequest.SendChunked%2A> property to `true`, and then sends an HTTP GET request. This exception occurs if an application tries to send chunked to a server that only supports HTTP 1.0 protocol, where this is not supported. This exception occurs if an application tries to send data without setting the <xref:System.Net.HttpWebRequest.ContentLength%2A> property or the <xref:System.Net.HttpWebRequest.SendChunked%2A> is `false` when buffering is disabled and on a keepalive connection (the <xref:System.Net.HttpWebRequest.KeepAlive%2A> property is `true`)`.`
If a <xref:System.Net.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.
The <xref:System.Net.HttpWebRequest.BeginGetResponse%2A> method requires some synchronous setup tasks to complete (DNS resolution, proxy detection, and TCP socket connection, for example) before this method becomes asynchronous. As a result, this method should never be called on a user interface (UI) thread because it might take considerable time (up to several minutes depending on network settings) to complete the initial synchronous setup tasks before an exception for an error is thrown or the method succeeds.
To learn more about the thread pool, see [The managed thread pool](~/docs/standard/threading/the-managed-thread-pool.md).
> [!NOTE]
> Your application cannot mix synchronous and asynchronous methods for a particular request. If you call the <xref:System.Net.HttpWebRequest.BeginGetRequestStream%2A> method, you must use the <xref:System.Net.HttpWebRequest.BeginGetResponse%2A> method to retrieve the response.
> [!NOTE]
> This member outputs trace information when you enable network tracing in your application. For more information, see [&#91;\<topic://conUsingNetworkTracing>&#93;](https://msdn.microsoft.com/library/e993b7c3-087f-45d8-9c02-9dded936d804).
## Examples
The following code example uses the <xref:System.Net.HttpWebRequest.BeginGetResponse%2A> method to make an asynchronous request for an Internet resource.
> [!NOTE]
> In the case of asynchronous requests, it is the responsibility of the client application to implement its own time-out mechanism. The following code example shows how to do it.
[!code-cpp[System.Net.HttpWebRequest.BeginGetResponse#1](~/samples/snippets/cpp/VS_Snippets_Remoting/System.Net.HttpWebRequest.BeginGetResponse/CPP/begingetresponse.cpp#1)]
[!code-csharp[System.Net.HttpWebRequest.BeginGetResponse#1](~/samples/snippets/csharp/VS_Snippets_Remoting/System.Net.HttpWebRequest.BeginGetResponse/CS/begingetresponse.cs#1)]
[!code-vb[System.Net.HttpWebRequest.BeginGetResponse#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/System.Net.HttpWebRequest.BeginGetResponse/VB/begingetresponse.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The stream is already in use by a previous call to <see cref="M:System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback,System.Object)" />
-or-
<see cref="P:System.Net.HttpWebRequest.TransferEncoding" /> is set to a value and <see cref="P:System.Net.HttpWebRequest.SendChunked" /> is <see langword="false" />.
-or-
The thread pool is running out of threads.</exception>
<exception cref="T:System.Net.ProtocolViolationException">
<see cref="P:System.Net.HttpWebRequest.Method" /> is GET or HEAD, and either <see cref="P:System.Net.HttpWebRequest.ContentLength" /> is greater than zero or <see cref="P:System.Net.HttpWebRequest.SendChunked" /> is <see langword="true" />.
-or-
<see cref="P:System.Net.HttpWebRequest.KeepAlive" /> is <see langword="true" />, <see cref="P:System.Net.HttpWebRequest.AllowWriteStreamBuffering" /> is <see langword="false" />, and either <see cref="P:System.Net.HttpWebRequest.ContentLength" /> is -1, <see cref="P:System.Net.HttpWebRequest.SendChunked" /> is <see langword="false" /> and <see cref="P:System.Net.HttpWebRequest.Method" /> is POST or PUT.
-or-
The <see cref="T:System.Net.HttpWebRequest" /> has an entity body but the <see cref="M:System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback,System.Object)" /> method is called without calling the <see cref="M:System.Net.HttpWebRequest.BeginGetRequestStream(System.AsyncCallback,System.Object)" /> method.
-or-
The <see cref="P:System.Net.HttpWebRequest.ContentLength" /> is greater than zero, but the application does not write all of the promised data.</exception>
<exception cref="T:System.Net.WebException">
<see cref="M:System.Net.HttpWebRequest.Abort" /> was previously called.</exception>
<related type="Article" href="https://msdn.microsoft.com/library/9d663c4b-07b4-4f6f-9b12-efbd3630354f">DefaultProxy Element (Network Settings)</related>
</Docs>
</Member>
<Member MemberName="ClientCertificates">
<MemberSignature Language="C#" Value="public System.Security.Cryptography.X509Certificates.X509CertificateCollection ClientCertificates { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Security.Cryptography.X509Certificates.X509CertificateCollection ClientCertificates" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.ClientCertificates" />
<MemberSignature Language="VB.NET" Value="Public Property ClientCertificates As X509CertificateCollection" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Security::Cryptography::X509Certificates::X509CertificateCollection ^ ClientCertificates { System::Security::Cryptography::X509Certificates::X509CertificateCollection ^ get(); void set(System::Security::Cryptography::X509Certificates::X509CertificateCollection ^ value); };" />
<MemberSignature Language="F#" Value="member this.ClientCertificates : System.Security.Cryptography.X509Certificates.X509CertificateCollection with get, set" Usage="System.Net.HttpWebRequest.ClientCertificates" />
<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>
</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.Security.Cryptography.X509Certificates.X509CertificateCollection</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the collection of security certificates that are associated with this request.</summary>
<value>The <see cref="T:System.Security.Cryptography.X509Certificates.X509CertificateCollection" /> that contains the security certificates associated with this request.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
An application can add a certificate to a collection, but might not have access rights to it. To use a certificate contained in the collection, the application must have the same access rights as the entity that issued the certificate.
> [!NOTE]
> The Framework caches SSL sessions as they are created and attempts to reuse a cached session for a new request, if possible. When attempting to reuse an SSL session, the Framework uses the first element of <xref:System.Net.HttpWebRequest.ClientCertificates%2A> (if there is one), or tries to reuse an anonymous sessions if <xref:System.Net.HttpWebRequest.ClientCertificates%2A> is empty.
> [!NOTE]
> For performance reasons, you shouldn't add a client certificate to a <xref:System.Net.HttpWebRequest> unless you know the server will ask for it.
>
> For a code example illustrating how to enumerate the certificates in the client certificate store, see the <xref:System.Security.Cryptography.X509Certificates.X509Certificate2Collection> class.
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The value specified for a set operation is <see langword="null" />.</exception>
</Docs>
</Member>
<Member MemberName="Connection">
<MemberSignature Language="C#" Value="public string Connection { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Connection" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.Connection" />
<MemberSignature Language="VB.NET" Value="Public Property Connection As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Connection { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Connection : string with get, set" Usage="System.Net.HttpWebRequest.Connection" />
<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>
</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>Gets or sets the value of the <see langword="Connection" /> HTTP header.</summary>
<value>The value of the <see langword="Connection" /> HTTP header. The default value is <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The request sends the <xref:System.Net.HttpWebRequest.Connection%2A> property to the Internet resource as the `Connection` HTTP header. If the value of the <xref:System.Net.HttpWebRequest.KeepAlive%2A> property is `true`, the value "Keep-alive" is appended to the end of the `Connection` header.
To clear the `Connection` HTTP header, set the <xref:System.Net.HttpWebRequest.Connection%2A> property to `null`.
Changing the <xref:System.Net.HttpWebRequest.Connection%2A> property after the request has been started by calling the <xref:System.Net.HttpWebRequest.GetRequestStream%2A>, <xref:System.Net.HttpWebRequest.BeginGetRequestStream%2A>, <xref:System.Net.HttpWebRequest.GetResponse%2A>, or <xref:System.Net.HttpWebRequest.BeginGetResponse%2A> method throws an <xref:System.InvalidOperationException>.
> [!NOTE]
> The value for this property is stored in <xref:System.Net.WebHeaderCollection>. If WebHeaderCollection is set, the property value is lost.
## Examples
The following code example uses the <xref:System.Net.HttpWebRequest.Connection%2A> property to set the value of the Connection HTTP Header.
[!code-cpp[HttpWebRequest_Connection#1](~/samples/snippets/cpp/VS_Snippets_Remoting/HttpWebRequest_Connection/CPP/httpwebrequest_connection.cpp#1)]
[!code-csharp[HttpWebRequest_Connection#1](~/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_Connection/CS/httpwebrequest_connection.cs#1)]
[!code-vb[HttpWebRequest_Connection#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/HttpWebRequest_Connection/VB/httpwebrequest_connection.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">The value of <see cref="P:System.Net.HttpWebRequest.Connection" /> is set to Keep-alive or Close.</exception>
</Docs>
</Member>
<Member MemberName="ConnectionGroupName">
<MemberSignature Language="C#" Value="public override string ConnectionGroupName { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ConnectionGroupName" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.ConnectionGroupName" />
<MemberSignature Language="VB.NET" Value="Public Overrides 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.HttpWebRequest.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>
</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.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the name of the connection group for the request.</summary>
<value>The name of the connection group for this request. The default value is <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.ConnectionGroupName%2A> property enables you to associate a request with a connection group. This is useful when your application makes requests to one server for different users, such as a Web site that retrieves customer information from a database server.
## Examples
The following code example show how to use user information to form a connection group, assuming that the variables `username`, `password`, and `domain` are set by the application before this code is called.
[!code-cpp[Classic HttpWebRequest.ConnectionGroupName Example#1](~/samples/snippets/cpp/VS_Snippets_Remoting/Classic HttpWebRequest.ConnectionGroupName Example/CPP/source.cpp#1)]
[!code-csharp[Classic HttpWebRequest.ConnectionGroupName Example#1](~/samples/snippets/csharp/VS_Snippets_Remoting/Classic HttpWebRequest.ConnectionGroupName Example/CS/source.cs#1)]
[!code-vb[Classic HttpWebRequest.ConnectionGroupName Example#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/Classic HttpWebRequest.ConnectionGroupName Example/VB/source.vb#1)]
]]></format>
</remarks>
<block subset="none" type="overrides">
<para>Each connection group creates additional connections for a server. This may result in exceeding the number of connections set by the <see cref="P:System.Net.ServicePoint.ConnectionLimit" /> property for that server.</para>
</block>
<altmember cref="P:System.Net.Configuration.ConnectionManagementElement.MaxConnection" />
<altmember cref="P:System.Net.WebRequest.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 override long ContentLength { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int64 ContentLength" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.ContentLength" />
<MemberSignature Language="VB.NET" Value="Public Overrides 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.HttpWebRequest.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>
</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>
</Attributes>
<ReturnValue>
<ReturnType>System.Int64</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the <see langword="Content-length" /> HTTP header.</summary>
<value>The number of bytes of data to send to the Internet resource. The default is -1, which indicates the property has not been set and that there is no request data to send.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.ContentLength%2A> property contains the value to send as the `Content-length` HTTP header with the request.
Any value other than -1 in the <xref:System.Net.HttpWebRequest.ContentLength%2A> property indicates that the request uploads data and that only methods that upload data are allowed to be set in the <xref:System.Net.HttpWebRequest.Method%2A> property.
After the <xref:System.Net.HttpWebRequest.ContentLength%2A> property is set to a value, that number of bytes must be written to the request stream that is returned by calling the <xref:System.Net.HttpWebRequest.GetRequestStream%2A> method or both the <xref:System.Net.HttpWebRequest.BeginGetRequestStream%2A> and the <xref:System.Net.HttpWebRequest.EndGetRequestStream%2A> methods.
> [!NOTE]
> The value for this property is stored in <xref:System.Net.WebHeaderCollection>. If WebHeaderCollection is set, the property value is lost.
## Examples
The following code example sets the <xref:System.Net.HttpWebRequest.ContentLength%2A> property to the length of the string being posted.
[!code-cpp[HttpWebRequest_ContentLength#4](~/samples/snippets/cpp/VS_Snippets_Remoting/HttpWebRequest_ContentLength/CPP/httpwebrequest_contentlength.cpp#4)]
[!code-csharp[HttpWebRequest_ContentLength#4](~/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_ContentLength/CS/httpwebrequest_contentlength.cs#4)]
[!code-vb[HttpWebRequest_ContentLength#4](~/samples/snippets/visualbasic/VS_Snippets_Remoting/HttpWebRequest_ContentLength/VB/httpwebrequest_contentlength.vb#4)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The request has been started by calling the <see cref="M:System.Net.HttpWebRequest.GetRequestStream" />, <see cref="M:System.Net.HttpWebRequest.BeginGetRequestStream(System.AsyncCallback,System.Object)" />, <see cref="M:System.Net.HttpWebRequest.GetResponse" />, or <see cref="M:System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback,System.Object)" /> method.</exception>
<exception cref="T:System.ArgumentOutOfRangeException">The new <see cref="P:System.Net.HttpWebRequest.ContentLength" /> value is less than 0.</exception>
</Docs>
</Member>
<Member MemberName="ContentType">
<MemberSignature Language="C#" Value="public override string ContentType { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string ContentType" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.ContentType" />
<MemberSignature Language="VB.NET" Value="Public Overrides 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.HttpWebRequest.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>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Attributes>
<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.String</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the value of the <see langword="Content-type" /> HTTP header.</summary>
<value>The value of the <see langword="Content-type" /> HTTP header. The default value is <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.ContentType%2A> property contains the media type of the request. Values assigned to the <xref:System.Net.HttpWebRequest.ContentType%2A> property replace any existing contents when the request sends the `Content-type` HTTP header.
To clear the `Content-type` HTTP header, set the <xref:System.Net.HttpWebRequest.ContentType%2A> property to `null`.
> [!NOTE]
> The value for this property is stored in <xref:System.Net.WebHeaderCollection> . If <xref:System.Net.WebHeaderCollection> is set, the property value is lost.
## Examples
The following code example sets the <xref:System.Net.HttpWebRequest.ContentType%2A> property.
[!code-cpp[HttpWebRequest_ContentLength#1](~/samples/snippets/cpp/VS_Snippets_Remoting/HttpWebRequest_ContentLength/CPP/httpwebrequest_contentlength.cpp#1)]
[!code-csharp[HttpWebRequest_ContentLength#1](~/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_ContentLength/CS/httpwebrequest_contentlength.cs#1)]
[!code-vb[HttpWebRequest_ContentLength#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/HttpWebRequest_ContentLength/VB/httpwebrequest_contentlength.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="ContinueDelegate">
<MemberSignature Language="C#" Value="public System.Net.HttpContinueDelegate ContinueDelegate { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Net.HttpContinueDelegate ContinueDelegate" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.ContinueDelegate" />
<MemberSignature Language="VB.NET" Value="Public Property ContinueDelegate As HttpContinueDelegate" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::Net::HttpContinueDelegate ^ ContinueDelegate { System::Net::HttpContinueDelegate ^ get(); void set(System::Net::HttpContinueDelegate ^ value); };" />
<MemberSignature Language="F#" Value="member this.ContinueDelegate : System.Net.HttpContinueDelegate with get, set" Usage="System.Net.HttpWebRequest.ContinueDelegate" />
<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>
</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.HttpContinueDelegate</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the delegate method called when an HTTP 100-continue response is received from the Internet resource.</summary>
<value>A delegate that implements the callback method that executes when an HTTP Continue response is returned from the Internet resource. The default value is <see langword="null" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.ContinueDelegate%2A> property specifies the callback method to call when the client receives a 100-Continue response.
When the <xref:System.Net.HttpWebRequest.ContinueDelegate%2A> property is set, the client calls the delegate whenever protocol responses of type <xref:System.Net.HttpStatusCode.Continue?displayProperty=nameWithType> (100) are received. This is useful if you want the client to display the status of the data being received from the Internet resource.
]]></format>
</remarks>
<altmember cref="P:System.Net.Configuration.HttpWebRequestElement.MaximumUnauthorizedUploadLength" />
</Docs>
</Member>
<Member MemberName="ContinueTimeout">
<MemberSignature Language="C#" Value="public int ContinueTimeout { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance int32 ContinueTimeout" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.ContinueTimeout" />
<MemberSignature Language="VB.NET" Value="Public Property ContinueTimeout As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property int ContinueTimeout { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.ContinueTimeout : int with get, set" Usage="System.Net.HttpWebRequest.ContinueTimeout" />
<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.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.MonoTODO</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a timeout, in milliseconds, to wait until the 100-Continue is received from the server.</summary>
<value>The timeout, in milliseconds, to wait until the 100-Continue is received.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the 100-Continue response is received before the timeout expires, the entity body can be sent.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="CookieContainer">
<MemberSignature Language="C#" Value="public virtual System.Net.CookieContainer CookieContainer { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Net.CookieContainer CookieContainer" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.CookieContainer" />
<MemberSignature Language="VB.NET" Value="Public Overridable Property CookieContainer As CookieContainer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property System::Net::CookieContainer ^ CookieContainer { System::Net::CookieContainer ^ get(); void set(System::Net::CookieContainer ^ value); };" />
<MemberSignature Language="F#" Value="member this.CookieContainer : System.Net.CookieContainer with get, set" Usage="System.Net.HttpWebRequest.CookieContainer" />
<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>
</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.CookieContainer</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the cookies associated with the request.</summary>
<value>A <see cref="T:System.Net.CookieContainer" /> that contains the cookies associated with this request.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.CookieContainer%2A> property provides an instance of the <xref:System.Net.CookieContainer> class that contains the cookies associated with this request.
<xref:System.Net.HttpWebRequest.CookieContainer%2A> is `null` by default. You must assign a <xref:System.Net.CookieContainer> object to the property to have cookies returned in the <xref:System.Net.HttpWebResponse.Cookies%2A> property of the <xref:System.Net.HttpWebResponse> returned by the <xref:System.Net.HttpWebRequest.GetResponse%2A> method.
> [!NOTE]
> For security reasons, cookies are disabled by default. If you want to use cookies, use the <xref:System.Net.HttpWebRequest.CookieContainer%2A> property to enable cookies.
## Examples
The following code example sends a request to a URL and displays the cookies returned in the response.
[!code-cpp[NCLCookies#1](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLCookies/CPP/cookiessnippets.cpp#1)]
[!code-csharp[NCLCookies#1](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLCookies/CS/cookiessnippets.cs#1)]
[!code-vb[NCLCookies#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLCookies/VB/cookiessnippets.vb#1)]
]]></format>
</remarks>
<altmember cref="T:System.Net.CookieContainer" />
</Docs>
</Member>
<Member MemberName="Credentials">
<MemberSignature Language="C#" Value="public override System.Net.ICredentials Credentials { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Net.ICredentials Credentials" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.Credentials" />
<MemberSignature Language="VB.NET" Value="Public Overrides 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.HttpWebRequest.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>
</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.ICredentials</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets authentication information for the request.</summary>
<value>An <see cref="T:System.Net.ICredentials" /> that contains 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.HttpWebRequest.Credentials%2A> property contains authentication information to identify the maker of the request. The <xref:System.Net.HttpWebRequest.Credentials%2A> property can be either a <xref:System.Net.NetworkCredential>, in which case the user, password, and domain information contained in the <xref:System.Net.NetworkCredential> object is used to authenticate the request, or it can be a <xref:System.Net.CredentialCache>, in which case the Uniform Resource Identifier (URI) of the request is used to determine the user, password, and domain information to use to authenticate the request.
In most client scenarios, you should use the <xref:System.Net.CredentialCache.DefaultCredentials%2A> property, which contains the credentials of the currently logged on user. To do this, set the <xref:System.Net.WebClient.UseDefaultCredentials%2A> property to `true` instead of setting this property.
If the <xref:System.Net.HttpWebRequest> class is being used in a middle-tier application, such as an ASP.NET application, the credentials in the <xref:System.Net.CredentialCache.DefaultCredentials%2A> property belong to the account running the ASP page (the server-side credentials). Typically, you would set this property to the credentials of the client on whose behalf the request is made.
> [!NOTE]
> The NTLM authentication scheme cannot be used to impersonate another user. Kerberos must be specially configured to support impersonation.
To restrict HttpWebRequest to one or more authentication methods, use the <xref:System.Net.CredentialCache> class and bind your credentials to one or more authentication schemes
Supported authentication schemes include Digest, Negotiate, Kerberos, NTLM, and Basic.
For security reasons, when automatically following redirects, store the credentials that you want to be included in the redirect in a <xref:System.Net.CredentialCache> and assign it to this property. This property will automatically be set to `null` upon redirection if it contains anything except a <xref:System.Net.CredentialCache>. Having this property value be automatically set to `null` under those conditions prevents credentials from being sent to any unintended destination.
## Examples
The following code example sets the credentials for a request.
[!code-cpp[NCLResponse1#1](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLResponse1/CPP/httpwebrequest1.cpp#1)]
[!code-csharp[NCLResponse1#1](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLResponse1/CS/httpwebrequest1.cs#1)]
[!code-vb[NCLResponse1#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLResponse1/VB/httpwebrequest1.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Date">
<MemberSignature Language="C#" Value="public DateTime Date { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance valuetype System.DateTime Date" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.Date" />
<MemberSignature Language="VB.NET" Value="Public Property Date As DateTime" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property DateTime Date { DateTime get(); void set(DateTime value); };" />
<MemberSignature Language="F#" Value="member this.Date : DateTime with get, set" Usage="System.Net.HttpWebRequest.Date" />
<MemberType>Property</MemberType>
<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>
</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.DateTime</ReturnType>
</ReturnValue>
<Docs>
<summary>Get or set the <see langword="Date" /> HTTP header value to use in an HTTP request.</summary>
<value>The Date header value in the HTTP request.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the Date header is `null`, then the return value will be set to <xref:System.DateTime.MinValue?displayProperty=nameWithType>.
The <xref:System.Net.HttpWebRequest.Date%2A> property is a standard <xref:System.DateTime?displayProperty=nameWithType> object and can contain a <xref:System.DateTimeKind?displayProperty=nameWithType> field of <xref:System.DateTimeKind.Local?displayProperty=nameWithType>, <xref:System.DateTimeKind.Utc?displayProperty=nameWithType>, or <xref:System.DateTimeKind.Unspecified?displayProperty=nameWithType>. Any kind of time can be set when using the <xref:System.Net.HttpWebRequest.Date%2A> property. If <xref:System.DateTimeKind.Unspecified?displayProperty=nameWithType> is set or retrieved, the <xref:System.Net.HttpWebRequest.Date%2A> property is assumed to be <xref:System.DateTimeKind.Local?displayProperty=nameWithType> (local time).
The classes in the <xref:System.Net> namespace always write it out the <xref:System.Net.HttpWebRequest.Date%2A> property on the wire during transmission in standard form using GMT (Utc) format.
If the <xref:System.Net.HttpWebRequest.Date%2A> property is set to <xref:System.DateTime.MinValue?displayProperty=nameWithType>, then the `Date` HTTP header is removed from the <xref:System.Net.HttpWebRequest.Headers%2A> property and the <xref:System.Net.WebHeaderCollection>.
If the <xref:System.Net.HttpWebRequest.Date%2A> property is <xref:System.DateTime.MinValue?displayProperty=nameWithType>, this indicates that the `Date` HTTP header is not included in the <xref:System.Net.HttpWebRequest.Headers%2A> property and the <xref:System.Net.WebHeaderCollection>.
> [!NOTE]
> The value for this property is stored in <xref:System.Net.WebHeaderCollection>. If WebHeaderCollection is set, the property value is lost.
If the <xref:System.Net.HttpWebRequest.Date%2A> is set and an attempt is made to send a <xref:System.Net.HttpWebRequest> with no body, then a <xref:System.Net.ProtocolViolationException?displayProperty=nameWithType> will be thrown by the <xref:System.Net.HttpWebRequest.BeginGetResponse%2A>, <xref:System.Net.HttpWebRequest.GetResponse%2A>, and <xref:System.Net.HttpWebRequest.EndGetResponse%2A> methods.
]]></format>
</remarks>
</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.HttpWebRequest.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.HttpWebRequest.DefaultCachePolicy" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
<AssemblyVersion>2.0.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="xamarinmac-3.0">
<AttributeName>System.MonoTODO</AttributeName>
</Attribute>
</Attributes>
<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
Setting this property registers the specified policy for the HTTP and HTTPS schemes. This policy is used for this request if:
There is no <xref:System.Net.WebRequest.CachePolicy%2A?displayProperty=nameWithType> property specified for this request.
\- or -
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.
]]></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.WebRequest.CachePolicy" />
</Docs>
</Member>
<Member MemberName="DefaultMaximumErrorResponseLength">
<MemberSignature Language="C#" Value="public static int DefaultMaximumErrorResponseLength { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property int32 DefaultMaximumErrorResponseLength" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.DefaultMaximumErrorResponseLength" />
<MemberSignature Language="VB.NET" Value="Public Shared Property DefaultMaximumErrorResponseLength As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static property int DefaultMaximumErrorResponseLength { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.DefaultMaximumErrorResponseLength : int with get, set" Usage="System.Net.HttpWebRequest.DefaultMaximumErrorResponseLength" />
<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>
</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="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.MonoTODO</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the default maximum length of an HTTP error response.</summary>
<value>The default maximum length of an HTTP error response.</value>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The value is less than 0 and is not equal to -1.</exception>
</Docs>
</Member>
<Member MemberName="DefaultMaximumResponseHeadersLength">
<MemberSignature Language="C#" Value="public static int DefaultMaximumResponseHeadersLength { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property int32 DefaultMaximumResponseHeadersLength" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.DefaultMaximumResponseHeadersLength" />
<MemberSignature Language="VB.NET" Value="Public Shared Property DefaultMaximumResponseHeadersLength As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; static property int DefaultMaximumResponseHeadersLength { int get(); void set(int value); };" />
<MemberSignature Language="F#" Value="member this.DefaultMaximumResponseHeadersLength : int with get, set" Usage="System.Net.HttpWebRequest.DefaultMaximumResponseHeadersLength" />
<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>
</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="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.MonoTODO("Use this")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the default for the <see cref="P:System.Net.HttpWebRequest.MaximumResponseHeadersLength" /> property.</summary>
<value>The length, in kilobytes (1024 bytes), of the default maximum for response headers received. The default configuration file sets this value to 64 kilobytes.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The length of the response header received the response status line and any extra control characters that are received as part of HTTP protocol. A value of -1 means no limit is imposed on the response headers received; a value of 0 means that all requests fail.
This value can also be changed in the configuration file. The impact of this property can be overridden by setting the <xref:System.Net.HttpWebRequest.MaximumResponseHeadersLength%2A> property on an instance of the <xref:System.Net.HttpWebRequest> class.
]]></format>
</remarks>
<exception cref="T:System.ArgumentOutOfRangeException">The value is not equal to -1 and is less than zero.</exception>
</Docs>
</Member>
<MemberGroup MemberName="EndGetRequestStream">
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Ends an asynchronous request for a <see cref="T:System.IO.Stream" /> object to use to write data.</summary>
</Docs>
</MemberGroup>
<Member MemberName="EndGetRequestStream">
<MemberSignature Language="C#" Value="public override System.IO.Stream EndGetRequestStream (IAsyncResult asyncResult);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.IO.Stream EndGetRequestStream(class System.IAsyncResult asyncResult) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.EndGetRequestStream(System.IAsyncResult)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function EndGetRequestStream (asyncResult As IAsyncResult) As Stream" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::IO::Stream ^ EndGetRequestStream(IAsyncResult ^ asyncResult);" />
<MemberSignature Language="F#" Value="override this.EndGetRequestStream : IAsyncResult -&gt; System.IO.Stream" Usage="httpWebRequest.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>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.IO.Stream</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="asyncResult" Type="System.IAsyncResult" />
</Parameters>
<Docs>
<param name="asyncResult">The pending request for a stream.</param>
<summary>Ends an asynchronous request for a <see cref="T:System.IO.Stream" /> object to use to write data.</summary>
<returns>A <see cref="T:System.IO.Stream" /> to use to write request data.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.EndGetRequestStream%2A> method completes an asynchronous request for a stream that was started by the <xref:System.Net.HttpWebRequest.BeginGetRequestStream%2A> method. After the <xref:System.IO.Stream> object has been returned, you can send data with the <xref:System.Net.HttpWebRequest> by using the <xref:System.IO.Stream.Write%2A?displayProperty=nameWithType> method.
> [!NOTE]
> You must set the value of the <xref:System.Net.HttpWebRequest.ContentLength%2A> property before writing data to the stream.
> [!CAUTION]
> You must call the <xref:System.IO.Stream.Close%2A?displayProperty=nameWithType> method to close the stream and release the connection for reuse. Failure to close the stream causes your application to run out of connections.
> [!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 code example uses the <xref:System.Net.HttpWebRequest.EndGetRequestStream%2A> method to end an asynchronous request for a stream instance.
[!code-cpp[HttpWebRequest_BeginGetRequestStream#2](~/samples/snippets/cpp/VS_Snippets_Remoting/HttpWebRequest_BeginGetRequestStream/CPP/httpwebrequest_begingetrequeststream.cpp#2)]
[!code-csharp[HttpWebRequest_BeginGetRequestStream#2](~/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_BeginGetRequestStream/CS/httpwebrequest_begingetrequeststream.cs#2)]
[!code-vb[HttpWebRequest_BeginGetRequestStream#2](~/samples/snippets/visualbasic/VS_Snippets_Remoting/HttpWebRequest_BeginGetRequestStream/VB/httpwebrequest_begingetrequeststream.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="asyncResult" /> is <see langword="null" />.</exception>
<exception cref="T:System.IO.IOException">The request did not complete, and no stream is available.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="asyncResult" /> was not returned by the current instance from a call to <see cref="M:System.Net.HttpWebRequest.BeginGetRequestStream(System.AsyncCallback,System.Object)" />.</exception>
<exception cref="T:System.InvalidOperationException">This method was called previously using <paramref name="asyncResult" />.</exception>
<exception cref="T:System.Net.WebException">
<see cref="M:System.Net.HttpWebRequest.Abort" /> was previously called.
-or-
An error occurred while processing the request.</exception>
</Docs>
</Member>
<Member MemberName="EndGetRequestStream">
<MemberSignature Language="C#" Value="public System.IO.Stream EndGetRequestStream (IAsyncResult asyncResult, out System.Net.TransportContext context);" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.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;netstandard-2.0;netcore-2.1;netframework-4.7.2;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.8" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.IO.Stream EndGetRequestStream(class System.IAsyncResult asyncResult, [out] class System.Net.TransportContext&amp; context) cil managed" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.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;netstandard-2.0;netcore-2.1;netframework-4.7.2;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.8" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.EndGetRequestStream(System.IAsyncResult,System.Net.TransportContext@)" />
<MemberSignature Language="VB.NET" Value="Public Function EndGetRequestStream (asyncResult As IAsyncResult, ByRef context As TransportContext) As Stream" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.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;netstandard-2.0;netcore-2.1;netframework-4.7.2;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.8" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::IO::Stream ^ EndGetRequestStream(IAsyncResult ^ asyncResult, [Runtime::InteropServices::Out] System::Net::TransportContext ^ % context);" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.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;netstandard-2.0;netcore-2.1;netframework-4.7.2;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.8" />
<MemberSignature Language="C#" Value="public System.IO.Stream EndGetRequestStream (IAsyncResult asyncResult, out System.Net.TransportContext transportContext);" FrameworkAlternate="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.IO.Stream EndGetRequestStream(class System.IAsyncResult asyncResult, [out] class System.Net.TransportContext&amp; transportContext) cil managed" FrameworkAlternate="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<MemberSignature Language="VB.NET" Value="Public Function EndGetRequestStream (asyncResult As IAsyncResult, ByRef transportContext As TransportContext) As Stream" FrameworkAlternate="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::IO::Stream ^ EndGetRequestStream(IAsyncResult ^ asyncResult, [Runtime::InteropServices::Out] System::Net::TransportContext ^ % transportContext);" FrameworkAlternate="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
<MemberSignature Language="F#" Value="override this.EndGetRequestStream : IAsyncResult * -&gt; System.IO.Stream" Usage="httpWebRequest.EndGetRequestStream (asyncResult, transportContext)" />
<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>
</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>
<Parameter Name="asyncResult" Type="System.IAsyncResult" Index="0" />
<Parameter Name="context" Type="System.Net.TransportContext" RefType="out" Index="1" FrameworkAlternate="netcore-1.0;netcore-1.1;netcore-2.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;netstandard-2.0;netcore-2.1;netframework-4.7.2;netframework-2.0;netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.8" />
<Parameter Name="transportContext" Type="System.Net.TransportContext" RefType="out" Index="1" FrameworkAlternate="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0" />
</Parameters>
<Docs>
<param name="asyncResult">The pending request for a stream.</param>
<param name="context">The <see cref="T:System.Net.TransportContext" /> for the <see cref="T:System.IO.Stream" />.</param>
<param name="transportContext">The <see cref="T:System.Net.TransportContext" /> for the <see cref="T:System.IO.Stream" />.</param>
<summary>Ends an asynchronous request for a <see cref="T:System.IO.Stream" /> object to use to write data and outputs the <see cref="T:System.Net.TransportContext" /> associated with the stream.</summary>
<returns>A <see cref="T:System.IO.Stream" /> to use to write request data.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.EndGetRequestStream%2A> method completes an asynchronous request for a stream that was started by the <xref:System.Net.HttpWebRequest.BeginGetRequestStream%2A> method and outputs the <xref:System.Net.TransportContext> associated with the stream. After the <xref:System.IO.Stream> object has been returned, you can send data with the <xref:System.Net.HttpWebRequest> by using the <xref:System.IO.Stream.Write%2A?displayProperty=nameWithType> method.
Some applications that use integrated Windows authentication with extended protection may need to be able to query the transport layer used by <xref:System.Net.HttpWebRequest> in order to retrieve the channel binding token (CBT) from the underlying TLS channel. The <xref:System.Net.HttpWebRequest.GetRequestStream%2A> method provides access to this information for HTTP methods which have a request body (`POST` and `PUT` requests). This is only needed if the application is implementing its own authentication and needs access to the CBT.
> [!NOTE]
> If an application needs to set the value of the <xref:System.Net.HttpWebRequest.ContentLength%2A> property, then this must be done before retrieving the stream and writing data to it.
> [!CAUTION]
> You must call the <xref:System.IO.Stream.Close%2A?displayProperty=nameWithType> method to close the stream and release the connection for reuse. Failure to close the stream causes your application to run out of connections.
> [!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).
]]></format>
</remarks>
<exception cref="T:System.ArgumentException">
<paramref name="asyncResult" /> was not returned by the current instance from a call to <see cref="M:System.Net.HttpWebRequest.BeginGetRequestStream(System.AsyncCallback,System.Object)" />.</exception>
<exception cref="T:System.ArgumentNullException">
<paramref name="asyncResult" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">This method was called previously using <paramref name="asyncResult" />.</exception>
<exception cref="T:System.IO.IOException">The request did not complete, and no stream is available.</exception>
<exception cref="T:System.Net.WebException">
<see cref="M:System.Net.HttpWebRequest.Abort" /> was previously called.
-or-
An error occurred while processing the request.</exception>
<altmember cref="T:System.Net.TransportContext" />
<altmember cref="M:System.Net.TransportContext.GetChannelBinding(System.Security.Authentication.ExtendedProtection.ChannelBindingKind)" />
<altmember cref="N:System.Security.Authentication.ExtendedProtection" />
<altmember cref="T:System.Security.Authentication.ExtendedProtection.ChannelBinding" />
<related type="Article" href="~/docs/framework/network-programming/integrated-windows-authentication-with-extended-protection.md">Integrated Windows Authentication with Extended Protection</related>
</Docs>
</Member>
<Member MemberName="EndGetResponse">
<MemberSignature Language="C#" Value="public override System.Net.WebResponse EndGetResponse (IAsyncResult asyncResult);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Net.WebResponse EndGetResponse(class System.IAsyncResult asyncResult) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.EndGetResponse(System.IAsyncResult)" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function EndGetResponse (asyncResult As IAsyncResult) As WebResponse" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::Net::WebResponse ^ EndGetResponse(IAsyncResult ^ asyncResult);" />
<MemberSignature Language="F#" Value="override this.EndGetResponse : IAsyncResult -&gt; System.Net.WebResponse" Usage="httpWebRequest.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>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Net.WebResponse</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="asyncResult" Type="System.IAsyncResult" />
</Parameters>
<Docs>
<param name="asyncResult">The pending request for a response.</param>
<summary>Ends an asynchronous request to an Internet resource.</summary>
<returns>A <see cref="T:System.Net.WebResponse" /> that contains the response from the Internet resource.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.EndGetResponse%2A> method completes an asynchronous request for an Internet resource that was started by calling the <xref:System.Net.HttpWebRequest.BeginGetResponse%2A> method.
> [!CAUTION]
> You must call the <xref:System.Net.HttpWebResponse.Close%2A> method to close the stream and release the connection. Failure to do so may cause your application to run out of connections.
> [!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 code example uses the <xref:System.Net.HttpWebRequest.EndGetResponse%2A> method to end an asynchronous request for an Internet resource.
[!code-cpp[HttpWebRequest_BeginGetResponse#2](~/samples/snippets/cpp/VS_Snippets_Remoting/HttpWebRequest_BeginGetResponse/CPP/httpwebrequest_begingetresponse.cpp#2)]
[!code-csharp[HttpWebRequest_BeginGetResponse#2](~/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_BeginGetResponse/CS/httpwebrequest_begingetresponse.cs#2)]
[!code-vb[HttpWebRequest_BeginGetResponse#2](~/samples/snippets/visualbasic/VS_Snippets_Remoting/HttpWebRequest_BeginGetResponse/VB/httpwebrequest_begingetresponse.vb#2)]
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="asyncResult" /> is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">This method was called previously using <paramref name="asyncResult." />
-or-
The <see cref="P:System.Net.HttpWebRequest.ContentLength" /> property is greater than 0 but the data has not been written to the request stream.</exception>
<exception cref="T:System.Net.WebException">
<see cref="M:System.Net.HttpWebRequest.Abort" /> was previously called.
-or-
An error occurred while processing the request.</exception>
<exception cref="T:System.ArgumentException">
<paramref name="asyncResult" /> was not returned by the current instance from a call to <see cref="M:System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback,System.Object)" />.</exception>
</Docs>
</Member>
<Member MemberName="Expect">
<MemberSignature Language="C#" Value="public string Expect { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance string Expect" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.Expect" />
<MemberSignature Language="VB.NET" Value="Public Property Expect As String" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; property System::String ^ Expect { System::String ^ get(); void set(System::String ^ value); };" />
<MemberSignature Language="F#" Value="member this.Expect : string with get, set" Usage="System.Net.HttpWebRequest.Expect" />
<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>
</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>Gets or sets the value of the <see langword="Expect" /> HTTP header.</summary>
<value>The contents of the <see langword="Expect" /> HTTP header. The default value is <see langword="null" />.
<block subset="none" type="note"><para>
The value for this property is stored in <see cref="T:System.Net.WebHeaderCollection" />. If WebHeaderCollection is set, the property value is lost.
</para></block></value>
<remarks>To be added.</remarks>
<exception cref="T:System.ArgumentException">
<see langword="Expect" /> is set to a string that contains "100-continue" as a substring.</exception>
<altmember cref="P:System.Net.Configuration.HttpWebRequestElement.MaximumUnauthorizedUploadLength" />
<related type="Article" href="https://msdn.microsoft.com/library/9d663c4b-07b4-4f6f-9b12-efbd3630354f">DefaultProxy Element (Network Settings)</related>
</Docs>
</Member>
<Member MemberName="GetHashCode">
<MemberSignature Language="C#" Value="public override int GetHashCode ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 GetHashCode() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.GetHashCode" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetHashCode () As Integer" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override int GetHashCode();" />
<MemberSignature Language="F#" Value="override this.GetHashCode : unit -&gt; int" Usage="httpWebRequest.GetHashCode " />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>netstandard</AssemblyName>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Int32</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>To be added.</summary>
<returns>To be added.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="GetObjectData">
<MemberSignature Language="C#" Value="protected override void GetObjectData (System.Runtime.Serialization.SerializationInfo serializationInfo, System.Runtime.Serialization.StreamingContext streamingContext);" />
<MemberSignature Language="ILAsm" Value=".method familyhidebysig 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.HttpWebRequest.GetObjectData(System.Runtime.Serialization.SerializationInfo,System.Runtime.Serialization.StreamingContext)" />
<MemberSignature Language="C++ CLI" Value="protected:&#xA; override void GetObjectData(System::Runtime::Serialization::SerializationInfo ^ serializationInfo, System::Runtime::Serialization::StreamingContext streamingContext);" />
<MemberSignature Language="F#" Value="override this.GetObjectData : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -&gt; unit" Usage="httpWebRequest.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>
</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="netcore-2.0;netcore-2.1">
<AttributeName>System.Obsolete("Serialization is obsoleted for this type. http://go.microsoft.com/fwlink/?linkid=14202")</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="serializationInfo" Type="System.Runtime.Serialization.SerializationInfo" />
<Parameter Name="streamingContext" Type="System.Runtime.Serialization.StreamingContext" />
</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 required 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>
<MemberGroup MemberName="GetRequestStream">
<AssemblyInfo>
<AssemblyName>System</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Gets a <see cref="T:System.IO.Stream" /> object to use to write request data.</summary>
</Docs>
</MemberGroup>
<Member MemberName="GetRequestStream">
<MemberSignature Language="C#" Value="public override System.IO.Stream GetRequestStream ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.IO.Stream GetRequestStream() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.GetRequestStream" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetRequestStream () As Stream" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::IO::Stream ^ GetRequestStream();" />
<MemberSignature Language="F#" Value="override this.GetRequestStream : unit -&gt; System.IO.Stream" Usage="httpWebRequest.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>
</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>Gets a <see cref="T:System.IO.Stream" /> object to use to write request data.</summary>
<returns>A <see cref="T:System.IO.Stream" /> to use to write request data.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.GetRequestStream%2A> method returns a stream to use to send data for the <xref:System.Net.HttpWebRequest>. After the <xref:System.IO.Stream> object has been returned, you can send data with the <xref:System.Net.HttpWebRequest> by using the <xref:System.IO.Stream.Write%2A?displayProperty=nameWithType> method.
If an application needs to set the value of the <xref:System.Net.HttpWebRequest.ContentLength%2A> property, then this must be done before retrieving the stream.
You must call the <xref:System.IO.Stream.Close%2A?displayProperty=nameWithType> method to close the stream and release the connection for reuse. Failure to close the stream causes your application to run out of connections.
> [!NOTE]
> Your application cannot mix synchronous and asynchronous methods for a particular request. If you call the <xref:System.Net.HttpWebRequest.GetRequestStream%2A> method, you must use the <xref:System.Net.HttpWebRequest.GetResponse%2A> method to retrieve the response.
> [!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 code example uses the <xref:System.Net.HttpWebRequest.GetRequestStream%2A> method to return a stream instance.
[!code-cpp[HttpWebRequest_ContentLength#4](~/samples/snippets/cpp/VS_Snippets_Remoting/HttpWebRequest_ContentLength/CPP/httpwebrequest_contentlength.cpp#4)]
[!code-csharp[HttpWebRequest_ContentLength#4](~/samples/snippets/csharp/VS_Snippets_Remoting/HttpWebRequest_ContentLength/CS/httpwebrequest_contentlength.cs#4)]
[!code-vb[HttpWebRequest_ContentLength#4](~/samples/snippets/visualbasic/VS_Snippets_Remoting/HttpWebRequest_ContentLength/VB/httpwebrequest_contentlength.vb#4)]
]]></format>
</remarks>
<exception cref="T:System.Net.ProtocolViolationException">The <see cref="P:System.Net.HttpWebRequest.Method" /> property is GET or HEAD.
-or-
<see cref="P:System.Net.HttpWebRequest.KeepAlive" /> is <see langword="true" />, <see cref="P:System.Net.HttpWebRequest.AllowWriteStreamBuffering" /> is <see langword="false" />, <see cref="P:System.Net.HttpWebRequest.ContentLength" /> is -1, <see cref="P:System.Net.HttpWebRequest.SendChunked" /> is <see langword="false" />, and <see cref="P:System.Net.HttpWebRequest.Method" /> is POST or PUT.</exception>
<exception cref="T:System.InvalidOperationException">The <see cref="M:System.Net.HttpWebRequest.GetRequestStream" /> method is called more than once.
-or-
<see cref="P:System.Net.HttpWebRequest.TransferEncoding" /> is set to a value and <see cref="P:System.Net.HttpWebRequest.SendChunked" /> is <see langword="false" />.</exception>
<exception cref="T:System.NotSupportedException">The request cache validator indicated that the response for this request can be served from the cache; however, requests that write data must not use the cache. This exception can occur if you are using a custom cache validator that is incorrectly implemented.</exception>
<exception cref="T:System.Net.WebException">
<see cref="M:System.Net.HttpWebRequest.Abort" /> was previously called.
-or-
The time-out period for the request expired.
-or-
An error occurred while processing the request.</exception>
<exception cref="T:System.ObjectDisposedException">In a .NET Compact Framework application, a request stream with zero content length was not obtained and closed correctly. For more information about handling zero content length requests, see [Network Programming in the .NET Compact Framework](https://msdn.microsoft.com/subscriptions/downloads/1afx2b0f\(v=vs.80\).aspx).</exception>
<related type="Article" href="https://msdn.microsoft.com/library/9d663c4b-07b4-4f6f-9b12-efbd3630354f">DefaultProxy Element (Network Settings)</related>
</Docs>
</Member>
<Member MemberName="GetRequestStream">
<MemberSignature Language="C#" Value="public System.IO.Stream GetRequestStream (out System.Net.TransportContext context);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance class System.IO.Stream GetRequestStream([out] class System.Net.TransportContext&amp; context) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.GetRequestStream(System.Net.TransportContext@)" />
<MemberSignature Language="VB.NET" Value="Public Function GetRequestStream (ByRef context As TransportContext) As Stream" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; System::IO::Stream ^ GetRequestStream([Runtime::InteropServices::Out] System::Net::TransportContext ^ % context);" />
<MemberSignature Language="F#" Value="override this.GetRequestStream : -&gt; System.IO.Stream" Usage="httpWebRequest.GetRequestStream context" />
<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>
</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="xamarinandroid-7.1;xamarinios-10.8;xamarinmac-3.0">
<AttributeName>System.MonoTODO</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.IO.Stream</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="context" Type="System.Net.TransportContext" RefType="out" />
</Parameters>
<Docs>
<param name="context">The <see cref="T:System.Net.TransportContext" /> for the <see cref="T:System.IO.Stream" />.</param>
<summary>Gets a <see cref="T:System.IO.Stream" /> object to use to write request data and outputs the <see cref="T:System.Net.TransportContext" /> associated with the stream.</summary>
<returns>A <see cref="T:System.IO.Stream" /> to use to write request data.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.GetRequestStream%2A> method returns a stream to use to send data for the <xref:System.Net.HttpWebRequest> and outputs the <xref:System.Net.TransportContext> associated with the stream. After the <xref:System.IO.Stream> object has been returned, you can send data with the <xref:System.Net.HttpWebRequest> by using the <xref:System.IO.Stream.Write%2A?displayProperty=nameWithType> method.
Some applications that use integrated Windows authentication with extended protection may need to be able to query the transport layer used by <xref:System.Net.HttpWebRequest> in order to retrieve the channel binding token (CBT) from the underlying TLS channel. The <xref:System.Net.HttpWebRequest.GetRequestStream%2A> method provides access to this information for HTTP methods which have a request body (`POST` and `PUT` requests). This is only needed if the application is implementing its own authentication and needs access to the CBT.
If an application needs to set the value of the <xref:System.Net.HttpWebRequest.ContentLength%2A> property, then this must be done before retrieving the stream.
You must call the <xref:System.IO.Stream.Close%2A?displayProperty=nameWithType> method to close the stream and release the connection for reuse. Failure to close the stream causes your application to run out of connections.
> [!NOTE]
> Your application cannot mix synchronous and asynchronous methods for a particular request. If you call the <xref:System.Net.HttpWebRequest.GetRequestStream%2A> method, you must use the <xref:System.Net.HttpWebRequest.GetResponse%2A> method to retrieve the response.
> [!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).
]]></format>
</remarks>
<exception cref="T:System.Exception">The <see cref="M:System.Net.HttpWebRequest.GetRequestStream" /> method was unable to obtain the <see cref="T:System.IO.Stream" />.</exception>
<exception cref="T:System.InvalidOperationException">The <see cref="M:System.Net.HttpWebRequest.GetRequestStream" /> method is called more than once.
-or-
<see cref="P:System.Net.HttpWebRequest.TransferEncoding" /> is set to a value and <see cref="P:System.Net.HttpWebRequest.SendChunked" /> is <see langword="false" />.</exception>
<exception cref="T:System.NotSupportedException">The request cache validator indicated that the response for this request can be served from the cache; however, requests that write data must not use the cache. This exception can occur if you are using a custom cache validator that is incorrectly implemented.</exception>
<exception cref="T:System.Net.ProtocolViolationException">The <see cref="P:System.Net.HttpWebRequest.Method" /> property is GET or HEAD.
-or-
<see cref="P:System.Net.HttpWebRequest.KeepAlive" /> is <see langword="true" />, <see cref="P:System.Net.HttpWebRequest.AllowWriteStreamBuffering" /> is <see langword="false" />, <see cref="P:System.Net.HttpWebRequest.ContentLength" /> is -1, <see cref="P:System.Net.HttpWebRequest.SendChunked" /> is <see langword="false" />, and <see cref="P:System.Net.HttpWebRequest.Method" /> is POST or PUT.</exception>
<exception cref="T:System.Net.WebException">
<see cref="M:System.Net.HttpWebRequest.Abort" /> was previously called.
-or-
The time-out period for the request expired.
-or-
An error occurred while processing the request.</exception>
<altmember cref="T:System.Net.TransportContext" />
<altmember cref="M:System.Net.TransportContext.GetChannelBinding(System.Security.Authentication.ExtendedProtection.ChannelBindingKind)" />
<altmember cref="N:System.Security.Authentication.ExtendedProtection" />
<altmember cref="T:System.Security.Authentication.ExtendedProtection.ChannelBinding" />
<related type="Article" href="~/docs/framework/network-programming/integrated-windows-authentication-with-extended-protection.md">Integrated Windows Authentication with Extended Protection</related>
</Docs>
</Member>
<Member MemberName="GetResponse">
<MemberSignature Language="C#" Value="public override System.Net.WebResponse GetResponse ();" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance class System.Net.WebResponse GetResponse() cil managed" />
<MemberSignature Language="DocId" Value="M:System.Net.HttpWebRequest.GetResponse" />
<MemberSignature Language="VB.NET" Value="Public Overrides Function GetResponse () As WebResponse" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; override System::Net::WebResponse ^ GetResponse();" />
<MemberSignature Language="F#" Value="override this.GetResponse : unit -&gt; System.Net.WebResponse" Usage="httpWebRequest.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>
</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>Returns a response from an Internet resource.</summary>
<returns>A <see cref="T:System.Net.WebResponse" /> that contains the response from the Internet resource.</returns>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Net.HttpWebRequest.GetResponse%2A> method returns a <xref:System.Net.WebResponse> object that contains the response from the Internet resource. The actual instance returned is an <xref:System.Net.HttpWebResponse>, and can be typecast to that class to access HTTP-specific properties.
A <xref:System.Net.ProtocolViolationException> is thrown in several cases when the properties set on the <xref:System.Net.HttpWebRequest> class are conflicting. This exception occurs if an application sets the <xref:System.Net.HttpWebRequest.ContentLength%2A> property and the <xref:System.Net.HttpWebRequest.SendChunked%2A> property to `true`, and then sends an HTTP GET request. This exception occurs if an application tries to send chunked to a server that only supports HTTP 1.0 protocol, where this is not supported. This exception occurs if an application tries to send data without setting the <xref:System.Net.HttpWebRequest.ContentLength%2A> property or the <xref:System.Net.HttpWebRequest.SendChunked%2A> is `false` when buffering is disabled and on a keepalive connection (the <xref:System.Net.HttpWebRequest.KeepAlive%2A> property is `true`)`.`
> [!CAUTION]
> You must call the <xref:System.Net.HttpWebResponse.Close%2A> method to close the stream and release the connection. Failure to do so may cause your application to run out of connections.
When using the POST method, you must get the request stream, write the data to be posted, and close the stream. This method blocks waiting for content to post; if there is no time-out set and you do not provide content, the calling thread blocks indefinitely.
> [!NOTE]
> Multiple calls to <xref:System.Net.HttpWebRequest.GetResponse%2A> return the same response object; the request is not reissued.
> [!NOTE]
> Your application cannot mix synchronous and asynchronous methods for a particular request. If you call the <xref:System.Net.HttpWebRequest.GetRequestStream%2A> method, you must use the <xref:System.Net.HttpWebRequest.GetResponse%2A> method to retrieve the response.
> [!NOTE]
> If a <xref:System.Net.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.
> [!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).
> [!NOTE]
> For security reasons, cookies are disabled by default. If you wish to use cookies, use the <xref:System.Net.HttpWebRequest.CookieContainer%2A> property to enable cookies.
## Examples
The following code example gets the response for a request.
[!code-cpp[NCLResponse1#1](~/samples/snippets/cpp/VS_Snippets_Remoting/NCLResponse1/CPP/httpwebrequest1.cpp#1)]
[!code-csharp[NCLResponse1#1](~/samples/snippets/csharp/VS_Snippets_Remoting/NCLResponse1/CS/httpwebrequest1.cs#1)]
[!code-vb[NCLResponse1#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/NCLResponse1/VB/httpwebrequest1.vb#1)]
]]></format>
</remarks>
<exception cref="T:System.InvalidOperationException">The stream is already in use by a previous call to <see cref="M:System.Net.HttpWebRequest.BeginGetResponse(System.AsyncCallback,System.Object)" />.
-or-
<see cref="P:System.Net.HttpWebRequest.TransferEncoding" /> is set to a value and <see cref="P:System.Net.HttpWebRequest.SendChunked" /> is <see langword="false" />.</exception>
<exception cref="T:System.Net.ProtocolViolationException">
<see cref="P:System.Net.HttpWebRequest.Method" /> is GET or HEAD, and either <see cref="P:System.Net.HttpWebRequest.ContentLength" /> is greater or equal to zero or <see cref="P:System.Net.HttpWebRequest.SendChunked" /> is <see langword="true" />.
-or-
<see cref="P:System.Net.HttpWebRequest.KeepAlive" /> is <see langword="true" />, <see cref="P:System.Net.HttpWebRequest.AllowWriteStreamBuffering" /> is <see langword="false" />, <see cref="P:System.Net.HttpWebRequest.ContentLength" /> is -1, <see cref="P:System.Net.HttpWebRequest.SendChunked" /> is <see langword="false" />, and <see cref="P:System.Net.HttpWebRequest.Method" /> is POST or PUT.
-or-
The <see cref="T:System.Net.HttpWebRequest" /> has an entity body but the <see cref="M:System.Net.HttpWebRequest.GetResponse" /> method is called without calling the <see cref="M:System.Net.HttpWebRequest.GetRequestStream" /> method.
-or-
The <see cref="P:System.Net.HttpWebRequest.ContentLength" /> is greater than zero, but the application does not write all of the promised data.</exception>
<exception cref="T:System.NotSupportedException">The request cache validator indicated that the response for this request can be served from the cache; however, this request includes data to be sent to the server. Requests that send data must not use the cache. This exception can occur if you are using a custom cache validator that is incorrectly implemented.</exception>
<exception cref="T:System.Net.WebException">
<see cref="M:System.Net.HttpWebRequest.Abort" /> was previously called.
-or-
The time-out period for the request expired.
-or-
An error occurred while processing the request.</exception>
<altmember cref="P:System.Net.HttpWebRequest.Timeout" />
<related type="Article" href="https://msdn.microsoft.com/library/9d663c4b-07b4-4f6f-9b12-efbd3630354f">DefaultProxy Element (Network Settings)</related>
</Docs>
</Member>
<Member MemberName="HaveResponse">
<MemberSignature Language="C#" Value="public virtual bool HaveResponse { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool HaveResponse" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.HaveResponse" />
<MemberSignature Language="VB.NET" Value="Public Overridable ReadOnly Property HaveResponse As Boolean" />
<MemberSignature Language="C++ CLI" Value="public:&#xA; virtual property bool HaveResponse { bool get(); };" />
<MemberSignature Language="F#" Value="member this.HaveResponse : bool" Usage="System.Net.HttpWebRequest.HaveResponse" />
<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>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.Net</AssemblyName>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets a value that indicates whether a response has been received from an Internet resource.</summary>
<value>
<see langword="true" /> if a response has been received; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following code example checks the <xref:System.Net.HttpWebRequest.HaveResponse%2A> property to determine if a response has been received from an Internet resource.
[!code-cpp[Httpwebrequest_HaveResponse#1](~/samples/snippets/cpp/VS_Snippets_Remoting/Httpwebrequest_HaveResponse/CPP/httpwebrequest_haveresponse.cpp#1)]
[!code-csharp[Httpwebrequest_HaveResponse#1](~/samples/snippets/csharp/VS_Snippets_Remoting/Httpwebrequest_HaveResponse/CS/httpwebrequest_haveresponse.cs#1)]
[!code-vb[Httpwebrequest_HaveResponse#1](~/samples/snippets/visualbasic/VS_Snippets_Remoting/Httpwebrequest_HaveResponse/VB/httpwebrequest_haveresponse.vb#1)]
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Headers">
<MemberSignature Language="C#" Value="public override System.Net.WebHeaderCollection Headers { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Net.WebHeaderCollection Headers" />
<MemberSignature Language="DocId" Value="P:System.Net.HttpWebRequest.Headers" />
<MemberSignature Language="VB.NET" Value="Public Overrides 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.HttpWebRequest.Headers" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Net.Requests</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>