On Android and UWP, everything is good.
However ONLY for iOS the code just runs/executes really slow. Any ideas?
var uri = new Uri(url);
using (var client = new HttpClient())
{
var request = (HttpWebRequest)WebRequest.Create(uri);
request.ContentType = "application/json";
request.Method = "POST";
request.ServerCertificateValidationCallback += (s, cert, chain, err) => true;
request.Headers.Add("Authorization", "Bearer " + accessToken);
using (var streamWriter = new StreamWriter(request.GetRequestStream()))
{
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
// Connect with Server
var response = (HttpWebResponse)request.GetResponse();
// Response
switch (response.StatusCode)
{
case HttpStatusCode.Accepted:
case HttpStatusCode.OK:
using (var streamReader = new StreamReader(response.GetResponseStream()))
{
var read = streamReader.ReadToEnd();
}
break;
}
}