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

230
Views
JavaScript : Get Empty String in Post Request

Edited : this solution don't works (Solution)

I have an API gave me String response as shown in image below

enter image description here

Now I want to creat request in javascript to save this response but it gave me empty string :

    fetch("https://xxxxxxxxxxxxxxxxx", {
      "method": "GET",
      "headers": {
        "Content-Type": "application/json",
        "Access-Control-Allow-Origin" : "*", 
        "Access-Control-Allow-Credentials" : true ,
        "authority": "clientportal.webresults-nt.com",
        "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"96\", \"Google Chrome\";v=\"96\"",
        "accept": "q=0.8;application/json;q=0.9",
        "content-type": "application/json; charset=utf-8",
        "user-token": "",
        "sec-ch-ua-mobile": "?0",
        "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36",
        "sec-ch-ua-platform": "\"Windows\"",
        "origin": "https://xxxxxxxxxxxxxxxxx",
        "sec-fetch-site": "cross-site",
        "sec-fetch-dest": "empty",
        "referer": "https://xxxxxxxxxxxxxxx/",
        "accept-language": "ar,en-US;q=0.9,en;q=0.8,fa;q=0.7,fr;q=0.6,ms;q=0.5,tr;q=0.4"
      }
    })
.then(response => response.text())
        .then((response) => {
            console.log(response)
        })
        .catch(err => console.log(err))

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!