I have a Windows Phone 8 project in which I started using the PCL (Portable Class Library) project, since I'm going to create a Win8 application.
However, when calling my api (in Azure), my HttpClient GetStringAsync is so slow. I threw a couple of debugs with datetime, and GetStringAsync took 14 seconds! And sometimes it takes longer.
What I am doing is getting simple JSON from my Azure API site. My Android client has no problem getting the same data in a split second ... so am I missing something?
The setup is pretty simple:
HttpClient client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); client.DefaultRequestHeaders.Add("X-Token", "something"); string responseJSON = await client.GetStringAsync("url");
I put the debug time right before and after waiting there, between 14 seconds!
Does anyone know why?
source share