diff --git a/.openpublishing.redirection.framework.json b/.openpublishing.redirection.framework.json index fc1ce33af060e..86c062d8841ec 100644 --- a/.openpublishing.redirection.framework.json +++ b/.openpublishing.redirection.framework.json @@ -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", @@ -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", @@ -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" } ] } diff --git a/docs/core/extensions/httpclient-factory.md b/docs/core/extensions/httpclient-factory.md index e4043245583b9..f06cec7e86c72 100644 --- a/docs/core/extensions/httpclient-factory.md +++ b/docs/core/extensions/httpclient-factory.md @@ -220,7 +220,7 @@ An 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 diff --git a/docs/fundamentals/networking/http/http-overview.md b/docs/fundamentals/networking/http/http-overview.md index c3e0f35ad8b9f..6b8d5bec9d03e 100644 --- a/docs/fundamentals/networking/http/http-overview.md +++ b/docs/fundamentals/networking/http/http-overview.md @@ -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 . For more information, see [Make HTTP requests with the HttpClient class](httpclient.md). Applications receive HTTP protocol errors by catching an . HTTP status codes are either reported in with the or in with the 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 . For more information, see [Make HTTP requests with the HttpClient class](httpclient.md). Applications receive HTTP protocol errors by catching an . HTTP status codes are either reported in with the or in with the 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 diff --git a/docs/fundamentals/networking/http/httpclient.md b/docs/fundamentals/networking/http/httpclient.md index 98b74409fe10d..50563d60ad4ce 100644 --- a/docs/fundamentals/networking/http/httpclient.md +++ b/docs/fundamentals/networking/http/httpclient.md @@ -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 @@ -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`. - - ## Use HTTP error handling When an HTTP request fails, the system throws the 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 error: @@ -346,8 +344,6 @@ There might be scenarios where you need to throw the - ## Configure an HTTP proxy An HTTP proxy can be configured in one of two ways. A default is specified on the property. Alternatively, you can specify a proxy on the property.