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

213
Views
Javascript (WebdriverIO): ¿Solicitud de API Restfull con promesa de solicitud?

Actualmente me enfrento a un desafío con una solicitud GET utilizando la biblioteca "solicitud-promesa". Actualmente usando Javascript con WedriverIO. La respuesta que recibo es un error de validación o un error de "autenticación cancelada del propietario del recurso".

Por favor, ¿alguien puede ayudarme y decirme si mi código a continuación es incorrecto o cuál es la mejor práctica para hacer esto?

 var fs = request = require('request-promise'); exports.request = async function () { const params = { uri: 'https://api-boxdev.abcportal.com' +'/abc/openportal/javawebtokenfrontend', rejectUnauthorized: false, method: 'GET', headers: { 'User-Agent': "request", Authorization: "Bearer "+ global_accessTokenVal } //commented out // headers = new Headers({ 'User-Agent': 'Request-Promise', 'Authorization': 'Bearer ' + global_accessTokenVal }) }; await request.get(params, async function Callback(error, response, body) { storecallbackJWTerror = error; storecallbackJWTResponse = response; storecallbackJWTBody = body; bodyResponse = JSON.parse(body) }) };

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!