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

194
Views
google cloud function not working, showing = response to preflight request doesn't pass access control check: It does not have HTTP ok status

Hi there I'm using google cloud function as a middleware for my POST CALL, and I'm getting this error

Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

The code in google cloud function is

exports.helloWorld = (req, res) => {
res.set("Access-Control-Allow-Origin", "*");
res.setHeader("Access-Control-Allow-Credentials", "true");
res.setHeader("Access-Control-Allow-Methods", "GET,HEAD,OPTIONS,POST,PUT");
res.setHeader("Access-Control-Allow-Headers", "Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers");

res.send({id: req.body.data._id, key: req.body.data._key, qty: req.body.data.quantity})
}

I'm just trying to get the _id, _key and quantity,

This is how I make the call

axios.post("url",  {_id,_key,quantity}, {headers: {
    'Content-Type' : 'application/json; charset=UTF-8'
}}).then(res => console.log(res, 'res ')) .catch(err => console.log(err,"err"));
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!