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

245
Views
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
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!