Hello everyone,
I want to do a easy Https request.
I've searched a long time in the internet and found code like this:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
But this code isnt working...
I have crated an easy http request, which works very good:
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(address);
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
{
var encoding = Encoding.GetEncoding(response.CharacterSet);
using (Stream responseStream = response.GetResponseStream())
using (StreamReader reader = new StreamReader(responseStream, encoding))
return reader.ReadToEnd();
}
But i need an Https Request. So how can I do that?
Thank you!