如何在xamarin中为ios和android调用comon web服务?
答
您发表新问题之前,搜索现有的,
consuming a php webservice in Xamarin PCL
复制!
顺便说一句,你可以使用来自http://jonathanpeppers.com/Blog/improving-http-performance-in-xamarin-applications
采取的HttpClient//Use this class as a singleton in an IoC container
class MyAppClient
{
readonly HttpClient _httpClient = new HttpClient();
public async Task<string> GetChuck()
{
return await _httpClient.Get("http://chucknorris.com");
}
}
//Although "using" is good in general, don't do this
using (var httpClient = new HttpClient())
{
return await _httpClient.Get("http://chucknorris.com");
}
代码示例