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

331
Visualizações
Empty payload after POSTing a file with FormData and Axios

I'm trying to send an image file to an API from a JavaScript using Axios but viewing the request in the console shows the payload as largely empty.

This is what I'm using to send the request

const formData = new FormData();
formData.append('image', e.files[0], 'logo.png');

axios.request({
  url: '/upload',
  method: 'post',
  data: formData,
  headers: {
    'Content-Type': 'multipart/form-data'
  }
})

The request is being sent, however, the payload for the request is showing only as this

------WebKitFormBoundaryQums9sVMBwuMo7hO
Content-Disposition: form-data; name="image"; filename="logo.png"
Content-Type: image/png


------WebKitFormBoundaryQums9sVMBwuMo7hO--

e.files[0] is a valid File object and I'm able to call text() and slice() on it and see the content. I've tried various image files and it's always the same.

Any help or suggestions would be greatly appreciated.

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