xamarin.forms ,Foursqaure api response is not displaying but works in postman and foursqaure site after providing api key ?where im wrong

Viewed 13
private async Task GetresultAsync()
{
    var client = new HttpClient();
    var request = new HttpRequestMessage
    {
        Method = HttpMethod.Get,
        RequestUri = new Uri("https://api.foursquare.com/v3/places/search?ll=15.3494005,75.142583&query=shops&fields=geocodes,categories,name,hours,fsq_id,price,rating,stats,location"),
        Headers =
        {
            { "Accept", "application/json" },
            { "Authorization", "fsq322aNlTt3+PuRKw5js/ndngtry/XxNV0Q70yzKjDTQn0=" 
        },
    },
};

using (var response = await client.SendAsync(request))
{
    response.EnsureSuccessStatusCode();
    var body = await response.Content.ReadAsStringAsync();
    Debug.WriteLine(body);
}

Please any suggestions? I'm very new to xamarin and I'm getting data in postman but not getting result in xamarin using RESTCLIENT OR HTTPCLIENT for( foursqaure places api for v3) where am I wrong?

0 Answers
Related