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

215
Views
http (not https) post request in vanilla js

I am trying (for a small personal project) to send an http (not https as I don't have it set up) to my vps running nodejs. I can send the request perfectly fine with postman, but trying to use the xmlhttprequest prints the following error to the console:

Access to XMLHttpRequest at 'http://207.154.211.105/?postBidone={%22id%22:{%22nome%22:%22esempio1%22,%22localita%22:%22esempio2%22,%22extra%22:%22esempio3%22},%22action%22:%22add%22,%22content%22:%22plastic%22}' from origin 'null' has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.

Do you know a way to successfully send the request? Thanks!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Please have a look at this post and enable CORS, which will fix this issue. How to enable cors nodejs with express?

If not please provide more code / context.

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