We are using below code to connect. But we are not sure where to add proxy settings. Can you please help ?
public void Initialise(HttpMessageHandler messageHandler = null, HttpClient httpClient =
null)
{
var username = _faxConfiguration.UserName;
var password = _faxConfiguration.Password;
if (string.IsNullOrEmpty(username))
throw new ArgumentException($"{username} has not been set.");
if (string.IsNullOrEmpty(password))
throw new ArgumentException($"{password} has not been set.");
Account = new Account(this);
Inbound = new Inbound(this);
Outbound = new Outbound(this);
Documents = new Documents(this);
HttpClient = messageHandler == null ? new HttpClient() : new HttpClient(messageHandler);
HttpClient = httpClient ?? HttpClient;
HttpClient.BaseAddress = new Uri($"https://rest.interfax.net/");
HttpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
HttpClient.DefaultRequestHeaders.Add("Authorization",
new List<string> { $"Basic {Utils.Base64Encode($"{username}:{password}")}" });
JsonConvert.DefaultSettings = () =>
{
var settings = new JsonSerializerSettings();
settings.Converters.Add(new StringEnumConverter { CamelCaseText = true });
return settings;
};
}
We are using below code to connect. But we are not sure where to add proxy settings. Can you please help ?