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

404
Vistas
Axios POST request gets CORS error but form submit works fine (Vimeo API)

I am trying out the upload videos API from Vimeo: https://developer.vimeo.com/api/upload/videos#form-approach

So I got the form from the first step, as shown here: picture of HTML form I got from upload.form field in the response

And I wanted to upload the video without users having to submit the form, so instead of redirecting the user to the form, I sent a POST request manually to the API endpoint given:

// resJson.upload.upload_link is the same link as the form action attribute
axios.post(resJson.upload.upload_link, formData, {
  headers: {
    'Content-Type': 'multipart/form-data',
  },
                                 
})

But I got a CORS error:

Access to XMLHttpRequest at {link} from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

However, the code works fine if I just submit using the form. May I ask what is the difference of submitting a form and doing a POST request to the same link? Is there any way that I can submit the form automatically without having users do anything? The form data is already on the client side browser so there is no need for the user to browse and upload the file manually.

about 4 years ago · Juan Pablo Isaza
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