Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

585
Vistas
How do make post request with Axios and sending the files data in `Files` rather than in the body content?

I'm looking at trying to write a JavaScript function to post data back to my API server with Axios. However, I need the file to be in the Files field of the request and not in the body.

let formData  = new FormData();
formData.append("files", acceptedFiles[0], 'image.jpeg');
let url = "https://webhook.site/39e22a22-7fe2-45e6-bf7b-ba406ea550cc"
let resp = await axios.post(url, formData,{
   headers: { 'content-type': 'multipart/form-data' }
});

Raw Content Received by webhook.site

------WebKitFormBoundaryu1izASXZlBjTDNFk
Content-Disposition: form-data; name="files"; filename="image.jpeg"
Content-Type: image/jpeg

enter image description here

But when I do it with something like Insomnia API client. I get no body and no content. But the file is in the Files part of the request.

enter image description here

How do I achieve the what Insomnia is doing?

about 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda