Skip to content

Commit

Permalink
Add warning about httpwebrequest
Browse files Browse the repository at this point in the history
  • Loading branch information
liveans committed Sep 22, 2024
1 parent fff95a3 commit a90e1c5
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ helpviewer_keywords:

This document aims to guide developers through the process of migrating from <xref:System.Net.HttpWebRequest>, <xref:System.Net.ServicePoint>, and <xref:System.Net.ServicePointManager> to <xref:System.Net.Http.HttpClient>. The migration is necessary due to the obsolescence of the older APIs and the numerous benefits offered by <xref:System.Net.Http.HttpClient>, including improved performance, better resource management, and a more modern and flexible API design. By following the steps outlined in this document, developers will be able to transition their codebases smoothly and take full advantage of the features provided by <xref:System.Net.Http.HttpClient>.

> ![WARNING]
> Migrating from `HttpWebRequest`, `ServicePoint`, and `ServicePointManager` to `HttpClient` is not just a "nice to have" performance improvement. It's crucial to understand that the existing `WebRequest` logic's performance is likely to degrade significantly once you move to .NET Core. This is because `WebRequest` is maintained as a minimal compatibility layer, which means it lacks many optimizations, such as connection reuse in numerous cases. Therefore, transitioning to `HttpClient` is essential to ensure your application's performance and resource management are up to modern standards.
## Migrating from <xref:System.Net.HttpWebRequest> to <xref:System.Net.Http.HttpClient>

Let's start with some examples:
Expand Down

0 comments on commit a90e1c5

Please sign in to comment.