Chris Rae
Chris Rae

Reputation: 5665

HTTPS equivalent of WebRequest.CreateHttp on Windows Phone 7?

I have some C# code in a Windows Phone app...

WebRequest wrq = WebRequest.CreateHttp("http://bing.com");

is it possible to make this use HTTPS instead? There's no CreateHttps, and no obvious flags for me to fiddle with.

Chris

Upvotes: 1

Views: 595

Answers (2)

Alex Sorokoletov
Alex Sorokoletov

Reputation: 3101

Note you should not use CreateHttp in your app code! http://msdn.microsoft.com/en-us/library/ff382776%28v=vs.95%29.aspx

Upvotes: 1

codingbear
codingbear

Reputation: 15063

Have you tried following?

WebRequest wrq = WebRequest.Create("https://bing.com");

Notice that the url uses HTTPS scheme. I believe this should just work fine. Did you run into some issue with this method?

Upvotes: 2

Related Questions