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

179
Views
ReactJS API call - Need redirect URL in response from request with 30X status without redirecting

I have an API which returns 30X response and redirects to a specific URL. But, I want to get redirect URL from response without redirection.

I am using this in ReactJs code. Please find samples I tried:

let optionData = {
  method: "get",
  headers: headerData,
  maxRedirect: 0,
  redirect: "manual"
};
fetch(url, optionData)
    .then((response) => {
        //I need redirect URL here
        console.log(response);
        console.log(response.headers);
    })

Using this, I am getting response object as below:

{
  "body": null,
  "nodyUsed": false,
  "headers": {},
  "ok": false,
  "redirected": false,
  "status": 0,
  "statusText": "",
  "type": "opaqueredirect"
}

But, I am not getting redirect URL from this response.

I have also tried using axios, node-fetch, XMLHttpRequst.

Can you please help me to get this redirect url without redirection?

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!