question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

HttpClient instead of WebClient

See original GitHub issue

When using PuppeteerSharp with BlazorWASM, i get the following error

System.PlatformNotSupportedException: System.Net.WebClient is not supported on this platform. Use System.Net.Http.HttpClient instead. at System.Net.WebClient..ctor() at PuppeteerSharp.BrowserFetcher..ctor() in C:\projects\puppeteer-sharp\lib\PuppeteerSharp\BrowserFetcher.cs:line 53

Is there any plan to update Puppeteer to work use HttpClient instead of WebClient

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Cheatoidcommented, Jan 8, 2022

According to my quick GitHub search, there is only one place where WebClient is being used: in BrowserFetcher.
I would take a bite and say it should be pretty easy to migrate from WebClient to HttpClient.

0reactions
amazingalekcommented, Feb 19, 2023

I tried porting to HttpClient, but unfortunately it wasn’t the only blocker for using PuppeteerSharp with BlazorWASM. System.Diagnostics.Process is used for launching the browser, with or without Headless mode, and it’s not supported either. I don’t think supporting WASM will be easy.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Deciding between HttpClient and WebClient
WebClient uses HttpClient indirectly, because HttpWebRequest uses HttpClient internally even in .NET Framework, since at least 2018. Both ...
Read more >
When to use WebClient vs. HttpClient vs. HttpWebRequest
You should use HttpWebRequest instead of HttpClient whenever you need the additional features that HttpWebRequest provides. Further, unlike ...
Read more >
Differences Between System.Net.WebRequest, HttpClient ...
WebClient is just a wrapper around HttpWebRequest, so it uses HttpWebRequest internally. The WebClient bit slow compared to HttpWebRequest.But ...
Read more >
WebRequest, WebClient, and ServicePoint are obsolete - . ...
Use the System.Net.Http.HttpClient class instead. For FTP, since HttpClient doesn't support it, we recommend using a third-party library.
Read more >
WebClient vs HttpClient vs HttpWebRequest - Coding Strips
WebClient is a higher-level abstraction built on top of HttpWebRequest to simplify the most common tasks. Using WebClient is potentially slower ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found