Xamarin WebService本地主机

时间:2018-10-13 13:10:49

标签: android xamarin localhost

我正在与Xamarin开发一个项目。我正在尝试通过Android Web Service带来数据。 WebService正在运行。数据进入本地。但是androide没有来。

public partial class ListData : ContentPage
{
    private HttpClient client;
    URL url;
    Connection cnn;
    public ListData()
    {
        InitializeComponent();
        client = new HttpClient();
        cnn = new Connection();
    }
    async void btnEkle_Clicked(object sender, System.EventArgs e)
    {
        URL url = new URL("https://localhost:44364/api/values");
        client.BaseAddress = new Uri(url.ToString());
        var yanit = await client.GetAsync(url.ToString());
        var jsondata = yanit.Content.ReadAsStringAsync().Result;
        var root = JsonConvert.DeserializeObject<List<User>>(jsondata);
    }
}

0 个答案:

没有答案