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

246
Visualizações
Getting error on firebase response not being in json format as postman

This is my firebase cloud function. When user get's an error, it's not being readable.

exports.finishCheckoutPayment = functions.region('southamerica-east1').runWith({
  timeoutSeconds: 60,
  memory: '8GB',
}).https.onRequest((request, response) => {
  functions.logger.log('request data', request.body)
  cors(request, response, () => {
    let headers = {
      headers: {
        'Content-Type': 'application/json',
        access_token: 'my_api_token'
      }
    }
    functions.logger.log('body asaas request', request.body)
    axios.post('https://www.asaas.com/api/v3/payments', request.body, headers).then((data) => {
      functions.logger.log('RESPONSE funcionando', data.data)
    }).catch((error) => {
      return response.status(400).send(error)
    })
  })
})

postman returns normal json error, while firebase return this shit without the important info.

enter image description here

enter image description here

What can i do to fix this error response ?!

enter image description here

about 4 years ago · Juan Pablo Isaza
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