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

129
Views
Analizar las respuestas de la respuesta JSON
async sendMessage(message) { const slackEndpoint = 'https://hooks.slack.com/services/........'; return await axios.post(slackEndpoint, {text: message}) .catch((error) => console.log(error)); } let response = await this.sendMessage(message); this.logger.info('Sending Slack message for amount threshold: ' + message); console.log("!!!!!!!!!!!!! ", response.statusText ) if (response.statusText == 'OK') { this.logger.info('sent'); } else { this.logger.error('NOT send!'); }

obtengo respuesta:

 { status: 200, statusText: 'OK', headers: { date: 'Thu, 09 Dec 2021 17:29:29 GMT', .............. }

Y error:

 TypeError: Cannot read properties of undefined (reading 'statusText')

¿Sabe cómo puedo obtener correctamente el valor de statusText y compararlo?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Prueba esto:

 async sendMessage(message) { const slackEndpoint = 'https://hooks.slack.com/services/........'; return await axios.post(slackEndpoint, {text: message}) .then(response => response) .catch((error) => console.log(error)); }
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!