当前位置: 动力学知识库 > 问答 > 编程问答 >

c# - HttpClient.GetAsync() returning 404 error in WinRT Xaml Application

问题描述:

 private async Task<String> GetStringFromURI(String URIString)

{

Uri resourceUri;

if (!Uri.TryCreate(URIString.Trim(), UriKind.Absolute, out resourceUri))

{

return null;

}

string responseText;

try

{

response = await httpClient.GetAsync(resourceUri);

response.EnsureSuccessStatusCode();

responseText = await response.Content.ReadAsStringAsync();

}

catch (Exception ex)

{

responseText = ex.ToString();

}

return responseText;

}

This is my code when I send http url it works but https is not working. What could be the problem with that?

Call from browser:

Call from Mobile:

分享给朋友:
您可能感兴趣的文章:
随机阅读: