I've a .NET Core Controller API.
When accessing the Web Method(s) through secured link, i.e. https:///api/values, it's not working
If I'm accessing it with unsecured link, i.e. http:///api/values, it's working fine.
Please let me know if I need to do something into my Startup.cs or appsettings.json
Sample Code to access the API:
try { string serviceUrl= "https://domainname/api/values"; HttpClient client = new HttpClient(); HttpResponseMessage response = client.GetAsync(serviceUrl).Result; string stringData = response.Content.ReadAsStringAsync().Result; } catch (Exception ex) { throw ex; }
it's not working?IISto browse your code locally? because if that is the case thenhttpmakes sense.System.Net.ServicePointManager.SecurityProtocolas first line intryblock