Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

397
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!