简体   繁体   中英

Using netflixroulette API not working on Xamarin.Forms Based Android APP

When i am making call to netflix api ( https://netflixroulette.net/api/api.php?actor=Richard ) in Xamarin.Forms for Android. it gives error like "Java.Net.UnknownHostException: Unable to resolve host "netflixroulette.net": No address associated with hostname" but for other api's its working fine.

private string url = "https://netflixroulette.net/api/api.php?actor=";
        private HttpClient _client = new HttpClient(new NativeMessageHandler());
var content = await _client.GetStringAsync(url + e.NewTextValue);
            var movies = JsonConvert.DeserializeObject<List<Movie>>(content);

            lst.ItemsSource = movies;

I am using these packages Microsoft.Bcl.Build, Microsoft.Net.Http, Newtonsoft.Json, modernhttpclient

You have an invalid character ( ) in your URL:

Wrong:

https://netflixroulette.net/api/api.php?actor=Richard

Correct:

https://netflixroulette.net/api/api.php?actor=Richard

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM