I am trying to consume a REST API that the protocol is HTTP, no HTTPS. But, as Sharepoint Online uses protocol HTTPS, I am getting this error:
Mixed Content: The page at 'https://integralinf.sharepoint.com/sites/guilherme.nass/fischer/SitePages/P%C3%A1gina%20Inicial.aspx' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://api.promasters.net.br/cotacao/v1/valores/'. This request has been blocked; the content must be served over HTTPS.
My code is:
$(document).ready(function() {
$.ajax({
method: 'get',
url: 'http://api.promasters.net.br/cotacao/v1/valores/',
success: function(data){
console.log(data);
},
error: function(err) {
console.log(err);
}
});
});
I can't change the REST API to uses HTTPS, because it's not my API, it is only an API that I found.
Is there any solution for this? I really need to use this API.