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

214
Views
How to show full JSON response in console from Axios GET request

my issue is that I need to see all the items. When I run my script I get an array of objects in my log, but it doesn't show them all ... 40541 more items is not expected, i'm trying to log all the items

[
    {},
    {},
    ... 40541 more items
]

My package.json is logging all data to reportData.log after I run npm run start in my console. here is the scripts portion of my package.json

"scripts": {
    "start": "node --experimental-json-modules reportScript.js > reportData.log"
  },

here is the code in my reportScript.js, pseudo variables have been added

function getReport() {
    axios({
        method: 'get',
        url: reportEndpoint, //not actual, just pseudo
        headers: {
            'Content-Type':'application/json', 
            'Cookie':`sess.jwt=${sessJwt}`, //not actual, just pseudo
            'integration-key': `${integrationKey}`//not actual, just pseudo
        }
    })
    .then(response => {
        var reportResponse = response.data;
        console.log(reportResponse);
    })
}
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I think you should add {responseType: 'json'} in axios args object like this

axios({
        method: 'get',
        url: reportEndpoint, 
        responseType: 'json',
        headers: {
            'Content-Type':'application/json', 
            'Cookie':`sess.jwt=${sessJwt}`, 
            'integration-key': `${integrationKey}`
        }
    })

If still you will not get objects content bcoz in console we can't see all data if you are using small data then it sometimes visible to you.

Or else you can render your data on browser and it will be more preferable just use json extension in browser.

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!