0
Hello, I have a problem with CORS in the Climatempo API, my request code is this:
var api_url = '"http://apiadvisor.climatempo.com.br/api/v1/anl/synoptic/locale/BR?token=TOKEN"';
$.ajax({
url: api_url,
contentType: "application/json",
crossDomain: true,
dataType: 'json',
success: function(result){
console.log(result)
}
})
I’ve tried switching to jsonp
, but also I did not succeed, I’m stuck for a long time here and everything I saw on the internet did not solve
Thank you for the answer ! Now I have another error Cross origin requests are only supported for Protocol schemes: http, data, Chrome, Chrome-Extension, https.
– Gabriel Nunes
You have to run on an http page, as localhost @Gabrielnunes on FILE protocol does not work.
– Guilherme Nascimento
Thank you very much!!! It worked now!!
– Gabriel Nunes
@Gabrielnunes for nothing, if possible mark the answer as correct
– Guilherme Nascimento