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

312
Visualizações
Why is my request working in postman but not axios?

I am trying to make a request in axios. The same request works in postman.

await axios({
      method: "post",
      url: `https://ecommersappbytim.herokuapp.com/info/${userId}/update-user`,
      header: {
        "Content-Type": "application/json",
        "auth-token": { token },
      },
      data: {
        firstName: userInfo.fName,
        lastName: userInfo.lName,
        email: userInfo.email,
        password: userInfo.password,
      },
    })

Is there something I am missing? I have made sure that I am passing in the correct data.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I have found the same error, apparently it is a CORS problem with the headers. What worked for me was passing the token through the url in the form of a query and receiving it in the backend through passport with its jwtFromRequest: ExtractJWT.fromUrlQueryParameter('auth-token'). I don't know if it is the most optimal way to pass the token to the backend but it is the one that worked for me.

I hope this has helped you.

almost 4 years ago · Nicolás Marsili Relatório
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