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

1.5K
Views
Axios setRequestHeader method with UTF-8

I am trying to add some headers in my request. But header values may include some Turkish characters (like ğ, ş, ö etc.) and when I tried this, I got this error:

TypeError: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': String contains non ISO-8859-1 code point.
    at setRequestHeader (xhr.js:132)
    at Object.forEach (utils.js:253)
    at dispatchXhrRequest (xhr.js:126)
    at new Promise (<anonymous>)
    at xhrAdapter (xhr.js:13)
    at dispatchRequest (dispatchRequest.js:52)
    at :3000/report/async http:/localhost:3000/static/js/main.chunk.js:4137

I guess axios supports ISO-8859-1 characters when add my custom headers to header list. Is it possible change axios' supported charset to UTF-8?

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

let headers = {"userId": user.id, "username":user.username, "relatedName": encodeURIComponent(values.username)}; Encode at React. relatedName = URLDecoder.decode(request.getHeader("relatedName"), StandardCharsets.UTF_8.name()); Decode at Java.

over 4 years ago · Santiago Trujillo 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!