Forum Cross Platform with Xamarin
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

await client.GetAsync(URL) throws no response.

DeepakRamesh.4741DeepakRamesh.4741 USMember ✭✭
edited August 2017 in Cross Platform with Xamarin

Please help me, how to rectify this issue, in normal console application it works, but when i use Xamarin its throws no response. code snippet mentioned below,

static async Task<string> DownloadPage(string username)
            var client = new HttpClient();
            string url =("" + username);
             HttpResponseMessage response = await client.GetAsync(new Uri(url));
            string result = await response.Content.ReadAsStringAsync().ConfigureAwait(false);
            return result;
        catch (Exception ex)
            throw ex;


  • JohnHJohnH GBMember ✭✭✭✭✭

    Are you running this on iOS or Droid, on simulator/emulator or physical device, and can you use the web browser on that device to browse to that ip address? My guess is not...

  • prashantvcprashantvc USXamarin Team Xamurai

    Could you post the full stacktrace from the exception? I believe the WebAPIs are hosted on your local server, we may not get same result running it on our test machines

  • JesusAntonJesusAnton USMember ✭✭
    edited August 2017

    recomiendo usar esto

              public async Task<T> GetAsyncObj(string ruta)
                    var httpClient = new HttpClient();
                    var json = await httpClient.GetStringAsync(WebServiceUrl + ruta);
                    var taskModels = JsonConvert.DeserializeObject<T>(json);
                    return taskModels;
Sign In or Register to comment.