Closed Safeer-Ahmad closed 4 months ago
Any update on this, please?
here is a sample code I'm using but isn't picking up PAC proxy..
var handler = new HttpClientHandler(); handler.Proxy = WebRequest.GetSystemWebProxy(); handler.UseProxy = true; httpClient = new HttpClient(handler) { BaseAddress = new Uri("https://api.agify.io/") };
Since it's all BCL, it's likely a Mono issue, @steveisok can you assign someone to this please? Thanks!
This is getting frustrating now, it's been over a week, and still no response. Please update me on this issue ASAP as this is a blocker for us atm. Thanks
@Safeer-Ahmad What device(s) are you using and what api level are you targeting?
We are targeting Android 9 (pie) and running it on Samsung mobile, Datalogic HHT and Zebra TC 51 running android 9+
` HttpClientHandler handler = new HttpClientHandler { UseProxy = true, Proxy = WebRequest.DefaultWebProxy };
var client = new HttpClient(handler);
`
This worked for me, thanks all.
With support for Classic Xamarin.Android ended May 1st, 2024, this issue is likely no longer relevant.
If this still persists in .NET 8+, please open a new issue with updated information based on net8.0-android
or greater. Please include a link to this issue for context.
Android application type
Classic Xamarin.Android (MonoAndroid12.0, etc.)
Affected platform version
Xamarin.Android 11.2.2.1
Description
I've specified proxy on android using PAC file and have set HTTP client implementation to AndroidClientHandler and my expectation is when I send an HTTP request using HttpClient in my Forms project, it should be able to pick up the proxy settings and send the request accordingly. However, its not working and trying to hit the url directly than going through proxy.
I've looked at below issue and seems like there has been a fix released to use proxy if present.
https://github.com/xamarin/xamarin-android/issues/3058[](url)
Steps to Reproduce
Did you find any workaround?
No response
Relevant log output
No response