HttpClient instead of WebClient
See original GitHub issueWhen 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:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
toHttpClient
.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.