Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

204
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda