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

366
Views
React Error : x-csrf-token is not allowed by Access-Control-Allow-Headers in preflight response

I am trying to doing a post request by passing "X-CSRF-TOKEN" into the headers i am getting this error Request header field x-csrf-token is not allowed by Access-Control-Allow-Headers in preflight response. Below is my code.

const headers = {
      "Content-Type": "application/json",
      "X-CSRF-TOKEN": "g3DW38GFNJoUd9krAYwU8855GZs_fRfEPFFF9aJNLgI",
 "Access-Control-Allow-Headers":
      "Origin, X-Requested-With, Content-Type, Accept, Authorization,X-Auth-Token, X-CSRF-TOKEN",
      "Access-Control-Allow-Origin": "http://localhost:3000",
      "Access-Control-Allow-Credentials":"true"* 
    };
    axios
      .post(url,data,{ headers: headers })
      .then((res) => {
        console.log("response", res);
      })
      .catch((err) => {
        console.log(err);
      });
about 4 years ago · Santiago Trujillo
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!