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

65
Views
Establezca la imagen como src en un elemento html de imagen después de buscarlo con fetch

Intento obtener una imagen protegida por el token Bearer y quiero establecerla en la propiedad src de un elemento de imagen

 var headers = new Headers(); headers.append("Authorization", "Bearer " + getAccessToken()); var requestOptions = { method: 'GET', headers: headers, redirect: 'follow' }; fetch("__AUTH_HOST__/storage/o/user/" + getCookie('user_id') + '/' + username + '.png', requestOptions) .then(response => { if(response.status == 200){ document.getElementById('image_id').src = something } }).catch(error => console.error(error));

¿Hay alguna manera de lograr esto? o debo almacenarlo de alguna manera localmente?

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!