Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

253
Visualizações
How can I access an API without running into Allow Access Control Origin issues?

I've noticed that this seems to be a commonly asked question, but none of the responses I've seen have helped so far. I'm trying to access an API (Cuckoo Sandbox, set up on a VM) from my JavaScript+TypeScript application using an Axios call. This is what the code to call the API looks like.

      axios({
    method: 'get',
    url: 'http://192.168.1.220:1337/tasks/view',
    headers: {          
     'Authorization': 'Bearer WoRKpl5',
    //  'Allow-Control-Allow-Origin': '*'
  },
  }).then(resp =>{
    console.log("Hi")
  }).catch(err => { // then print response status
    console.log(err)
  });

The response is as shown below: Image of response

So far, I've tried editing the api_py file for cuckoo to include headers in the do_post function, modifying the headers in the axios call (commented out), running Chrome browser after disabling web security, trying to disable CORS (unsure if successful) and using a Proxy (CORS-anywhere) hosted on Heroku to add headers, among other things, without much success. Cuckoo Sandbox constantly receives only Options requests. Here is a screenshot of the current headers in the Cuckoo file:

Image of headers

I found it interesting to note that through the regular command line interface and the curl command, the API was working and we could successfully access it. Any further insight on how to successfully hit the API from the application for both GET and POST requests would be helpful.

Thanks

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda