Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

203
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda