Skip to content

Freshness Edit: dotnet content (followup) #45177

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 10, 2025
Merged
Show file tree
Hide file tree
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
8 changes: 4 additions & 4 deletions .openpublishing.redirection.framework.json
Original file line number Diff line number Diff line change
Expand Up @@ -3502,11 +3502,11 @@
},
{
"source_path_from_root": "/docs/framework/network-programming/accessing-the-internet-through-a-proxy.md",
"redirect_url": "/dotnet/fundamentals/networking/http/httpclient#http-proxy"
"redirect_url": "/dotnet/fundamentals/networking/http/httpclient#configure-an-http-proxy"
},
{
"source_path_from_root": "/docs/framework/network-programming/automatic-proxy-detection.md",
"redirect_url": "/dotnet/fundamentals/networking/http/httpclient#http-proxy"
"redirect_url": "/dotnet/fundamentals/networking/http/httpclient#configure-an-http-proxy"
},
{
"source_path_from_root": "/docs/framework/network-programming/how-to-override-a-global-proxy-selection.md",
Expand All @@ -3522,7 +3522,7 @@
},
{
"source_path_from_root": "/docs/framework/network-programming/proxy-configuration.md",
"redirect_url": "/dotnet/fundamentals/networking/http/httpclient#http-proxy"
"redirect_url": "/dotnet/fundamentals/networking/http/httpclient#configure-an-http-proxy"
},
{
"source_path_from_root": "/docs/framework/network-programming/changes-to-the-system-uri-namespace-in-version-2-0.md",
Expand All @@ -3534,7 +3534,7 @@
},
{
"source_path_from_root": "/docs/framework/network-programming/how-to-enable-a-webrequest-to-use-a-proxy-to-communicate-with-the-internet.md",
"redirect_url": "/dotnet/fundamentals/networking/http/httpclient#http-proxy"
"redirect_url": "/dotnet/fundamentals/networking/http/httpclient#configure-an-http-proxy"
}
]
}
2 changes: 1 addition & 1 deletion docs/core/extensions/httpclient-factory.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ An <xref:Microsoft.Extensions.DependencyInjection.IHttpClientBuilder> is returne

:::code source="snippets/http/configurehandler/Program.cs" id="configurehandler":::

Configuring the `HttClientHandler` lets you specify a proxy for the `HttpClient` instance among various other properties of the handler. For more information, see [Proxy per client](../../fundamentals/networking/http/httpclient.md#http-proxy).
Configuring the `HttClientHandler` lets you specify a proxy for the `HttpClient` instance among various other properties of the handler. For more information, see [Proxy per client](../../fundamentals/networking/http/httpclient.md#configure-an-http-proxy).

### Additional configuration

Expand Down
2 changes: 1 addition & 1 deletion docs/fundamentals/networking/http/http-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ The request methods are differentiated via several factors, first by their _verb

## HTTP status codes

.NET provides comprehensive support for the HTTP protocol, which accounts for most internet traffic, with the <xref:System.Net.Http.HttpClient>. For more information, see [Make HTTP requests with the HttpClient class](httpclient.md). Applications receive HTTP protocol errors by catching an <xref:System.Net.Http.HttpRequestException>. HTTP status codes are either reported in <xref:System.Net.Http.HttpResponseMessage> with the <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> or in <xref:System.Net.Http.HttpRequestException> with the <xref:System.Net.Http.HttpRequestException.StatusCode?displayProperty=nameWithType> in case the called method doesn't return a response message. For more information about error handling, see [HTTP error handling](httpclient.md#http-error-handling), and for more information about status codes, see [RFC 9110, HTTP Semantics: Status Codes](https://www.rfc-editor.org/rfc/rfc9110#name-status-codes).
.NET provides comprehensive support for the HTTP protocol, which accounts for most internet traffic, with the <xref:System.Net.Http.HttpClient>. For more information, see [Make HTTP requests with the HttpClient class](httpclient.md). Applications receive HTTP protocol errors by catching an <xref:System.Net.Http.HttpRequestException>. HTTP status codes are either reported in <xref:System.Net.Http.HttpResponseMessage> with the <xref:System.Net.Http.HttpResponseMessage.StatusCode?displayProperty=nameWithType> or in <xref:System.Net.Http.HttpRequestException> with the <xref:System.Net.Http.HttpRequestException.StatusCode?displayProperty=nameWithType> in case the called method doesn't return a response message. For more information about error handling, see [HTTP error handling](httpclient.md#use-http-error-handling), and for more information about status codes, see [RFC 9110, HTTP Semantics: Status Codes](https://www.rfc-editor.org/rfc/rfc9110#name-status-codes).

### Informational status codes

Expand Down
6 changes: 1 addition & 5 deletions docs/fundamentals/networking/http/httpclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Make HTTP requests with the HttpClient
description: Learn how to make HTTP requests and handle responses with the HttpClient in .NET.
author: IEvangelist
ms.author: dapine
ms.date: 03/06/2025
ms.date: 03/09/2025
---

# Make HTTP requests with the HttpClient class
Expand Down Expand Up @@ -309,8 +309,6 @@ When you know an HTTP endpoint returns JSON, you can deserialize the response bo

In this code, the `result` value is the response body deserialized as the type `T`.

<a name="http-error-handling"></a>

## Use HTTP error handling

When an HTTP request fails, the system throws the <xref:System.Net.Http.HttpRequestException> object. Catching the exception alone might not be sufficient. There are other potential exceptions thrown that you might want to consider handling. For example, the calling code might use a cancellation token that was canceled before the request completed. In this scenario, you can catch the <xref:System.Threading.Tasks.TaskCanceledException> error:
Expand Down Expand Up @@ -346,8 +344,6 @@ There might be scenarios where you need to throw the <xref:System.Net.Http.HttpR

:::code source="../snippets/httpclient/Program.ThrowHttpException.cs" id="throw":::

<a name="http-proxy"></a>

## Configure an HTTP proxy

An HTTP proxy can be configured in one of two ways. A default is specified on the <xref:System.Net.Http.HttpClient.DefaultProxy?displayProperty=nameWithType> property. Alternatively, you can specify a proxy on the <xref:System.Net.Http.HttpClientHandler.Proxy?displayProperty=nameWithType> property.
Expand Down
Loading