I\'m new to HttpClient class and I\'m having issue with monitoring requests using Charles Proxy. Basically what I need is to monitor the requests which are made either from
There's many ways to initialize HttpClient. Some ways won't talk with the OS (fully managed) and won't be aware of the iOS proxy settings.
The best (for iOS) is generally to use the handler that uses CFNetwork, see this blog for more details. Basically it means:
var client = new HttpClient (CFNetworkHandler ());
Otherwise you'll need to set the HttpClientHandler.Proxy to CFNetwork.GetDefaultProxy. E.g.
var handler = new HttpClientHandler {
Proxy = CFNetwork.GetDefaultProxy (),
UseProxy = true,
};
var client = new HttpClient(handler);