Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions xml/System.Net.Http/HttpClientHandler.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ The `HttpClientHandler` class and classes derived from it enable developers to c

### HttpClientHandler in .NET Core

Starting in .NET Core 2.1, the implementation of the `HttpClientHandler` class was changed to be based on the cross-platform HTTP protocol stack used by the <xref:System.Net.Http.SocketsHttpHandler?displayProperty=nameWithType> class. Prior to .NET Core 2.1, the `HttpClientHandler` class used older HTTP protocol stacks (<xref:System.Net.Http.WinHttpHandler> on Windows and `CurlHandler`, an internal class implemented on top of Linux's native libcurl component, on Linux).
Starting in .NET Core 2.1, the implementation of the `HttpClientHandler` class was changed to be based on the cross-platform HTTP protocol stack used by the <xref:System.Net.Http.SocketsHttpHandler?displayProperty=nameWithType> class. Prior to .NET Core 2.1, the `HttpClientHandler` class used older HTTP protocol stacks (<xref:System.Net.Http.WinHttpHandler> on Windows and `CurlHandler`, an internal class implemented on top of Linux's native `libcurl` component, on Linux).

You can configure your app to use the older HTTP protocol stacks in one of the following three ways:
On .NET Core 2.1 - 3.1 only, you can configure your app to use the older HTTP protocol stacks in one of the following three ways:

- Call the <xref:System.AppContext.SetSwitch%2A?displayProperty=nameWithType> method:

Expand All @@ -66,6 +66,8 @@ You can configure your app to use the older HTTP protocol stacks in one of the f

- Define an environment variable named `DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER` and set it to either `false` or **0**.

These configuration options are not available starting with .NET 5.

## Examples
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_Misc/system.net.http.httpclienthandler/cs/source.cs" id="Snippet1":::

Expand Down