Skip to content
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

Replace uses of WebRequest with HttpClient #1937

Merged
merged 4 commits into from
Jul 24, 2024

Conversation

glopesdev
Copy link
Member

@glopesdev glopesdev commented Jul 23, 2024

The WebRequest API has sadly been deprecated by the more performant HttpClient in modern .NET. As this API is also available in .NET Framework, this PR aligns the two code bases by replacing all instances of WebRequest with an alternative implementation using HttpClient.

There were two main uses of WebRequest in the current source code:

  • Retrieving package icons in the package manager dialog
  • Retrieve XRefMap YAML content for package docs

Each of these is addressed separately, as the reimplementation is quite specific for each case. An opportunity was taken to refactor package icon retrieval away from UI code to improve separation of concerns.

Fixes #1936

@glopesdev glopesdev added feature New planned feature fix Pull request that fixes an issue labels Jul 23, 2024
@glopesdev glopesdev added this to the 2.9 milestone Jul 23, 2024
Copy link
Member

@PathogenDavid PathogenDavid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few minor things

Bonsai.NuGet.Design/IconReader.cs Outdated Show resolved Hide resolved
Bonsai.NuGet.Design/IconReader.cs Outdated Show resolved Hide resolved
Bonsai.NuGet.Design/PackageViewController.cs Outdated Show resolved Hide resolved
@glopesdev glopesdev merged commit bc216bc into bonsai-rx:main Jul 24, 2024
10 checks passed
@glopesdev glopesdev deleted the issue-1936 branch July 24, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New planned feature fix Pull request that fixes an issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider replacing uses of WebRequest with HttpClient
2 participants