Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Restsharp is working on the simulator but not on the phone

$
0
0

I made an app that uses Restsharp to communicate with an asp.net web api json webservice. It works as it should on the simulator but on the phone response.Data is always null. How can I get restsharp to work on the phone, or are there any similar libraries. I use restsharp from here

Here is the code that gives me the error:

var hh = client.ExecuteAsync<List<Accommodation>>(request, (response) => {
    //on the phone response.Data is null
    if (response.StatusCode == HttpStatusCode.OK && response.Data != null)
        searchCompleteAction(response.Data);
    else
        searchCompleteAction(null);
        UIApplication.SharedApplication.NetworkActivityIndicatorVisible = false;
});

Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>