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

188
Views
Transform AxiosResponse to String

My application calls an API using axios.get, like below. Is there a way to console.log r and r.data so I can view it as a string?

const r = await axios.get(k);
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

If I understood well what you need, you could use JSON.stringify(), like so:

const r = await axios.get(k);
console.log(JSON.stringify(r));
console.log(JSON.stringify(r.data));
about 4 years ago · Juan Pablo Isaza Report

0

If the response is a JSON object, you can just use JSON.stringify() to get the response data as a string.

const r = await axios.get(k);
const stringResponse = JSON.stringify(r)
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!