How to make a web request using https in silverlight
I have
var client = new WebClient();
client.DownloadStringCompleted += (s, ea) =>
{
var ret = Newtonsoft开发者_如何转开发.Json.JsonConvert.DeserializeObject(ea.Result);
.....
};
var uri = new Uri("../myrest/Login", UriKind.Relative);
client.DownloadStringAsync(uri);
This works fine. But I want to send this request over https not plain http. I try manipulating the uri address to change the scheme to https
var url = "https://localhost/myrest/Login";// hardcoded for now
client.DownloadStringAsync(new Uri(url, UriKind.Absolute));
But this doesnt work. It triggers the whole clientaccesspolicy.xml thingy. Presumably because the base URL is different from the url used to load the xap
I know I have the absolute path correct, if I just change the 'https' to 'http' all works ok
SL4
try access your Silverlight thru HTTPS and use HTTPS login.
精彩评论