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

262
Views
Doing a basic auth req but getting 401
    let headers = new Headers()
    credentials = btoa(userName + ":" + password)
    headers.append("Authorization", "Basic " + credentials)
fetch("https://pikaso.me/api/v1/tweet?tweet_id=1468971637223555074", {}, {
    'method':'GET'
    headers:headers
})

    .then(res => res)
    .then(data => console.log(data))

Doing this gives a 401 error stating invalid credentials. Using pikaso API refer docs to https://pikaso.me/api

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

You should pass the headers and method as the second argument to fetch. Right now, you're passing an empty object as the second argument, and the headers and method as the third.

Try this instead:

fetch("https://pikaso.me/api/v1/tweet?tweet_id=1468971637223555074", {
    'method':'GET',
    headers:headers
})

See the documentation for the fetch function.

about 4 years ago · Santiago Gelvez 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!