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

216
Views
Converting from Content-type/html to Json in axios request Javascript

I am getting response from API using axios in Javascript. However, the problem i am facing is that response is coming as content-type: text/html; charset=UTF-8, I cannot parse the response since it is not JSON. Has anyone faced this problem earlier, i will say thank you if you guys help, Thank you so much.

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

0

You can set Accept: application/json in your request headers. Something like

axios.get(url, {
    headers: {
        Accept: 'application/json'
    }
}

It also depends on your back-end. If your back-end doesn't support JSON response, you can't get JSON.

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!