PUT AJAX api Climatempo returning CORS error

Asked

Viewed 136 times

0

Hello, I’m having problems performing a PUT in AJAX with the weather api, my code is this :

var URL = 'http://apiadvisor.climatempo.com.br/api-manager/user-token/TOKEN/locales';

$.ajax({
    url: URL,
    type: 'PUT',
    contentType:  'application/json',
    data: {'localeId': '3477'},
    dataType: 'json',
    success: function (result) {
        console.log("sucess?");
    }
});
}

the error that returns me is this:

Response to preflight request doesn't pass access control check: 
  No 'Access-Control-Allow-Origin' header is present on the requested resource.

the documentation of the api: inserir a descrição da imagem aqui

  • You have replaced the TOKEN value in your URL?

  • yeah, substitute, just didn’t put it here!

  • Checks on your access, in tokens, if CORS is disabled for your project.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.