# Error: Exceeded maxRedirects. Probably stuck in a redirect loop

**URL:** <https://community.postman.com/t/error-exceeded-maxredirects-probably-stuck-in-a-redirect-loop/31504>\
**Category:** Help Hub\
**Created:** [January 12, 2022, 10:50pm UTC](https://community.postman.com/t/error-exceeded-maxredirects-probably-stuck-in-a-redirect-loop/31504 "2022-01-12T22:50:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![descent-module-cosm1](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@descent-module-cosm1](https://community.postman.com/u/descent-module-cosm1)\
**Post date:** [January 12, 2022, 10:50pm UTC](https://community.postman.com/t/error-exceeded-maxredirects-probably-stuck-in-a-redirect-loop/31504/1 "2022-01-12T22:50:25Z")

</div>

Is there a way to increase the number of redirects in postman? Or correct this error?

I get this error when I run a POST request. The value of attempts is 150 in the code. But in Postman it seems to stop at 9.

Error: Exceeded maxRedirects. Probably stuck in a redirect loop https://url\_here.com/api/Search/WaitUntilDone?taskId=8bf016fd-690a-4884-9baa-f1bea73f7c85&attempt=9

Code:  
public async Task WaitUntilDone([FromQuery] Guid taskId, [FromQuery] int attempt = 0)  
{  
var response = new SearchCaseResponse();

```
  var task = await TaskContext.GetTaskAsync<SearchCaseTask>(taskId);

  if (task.Completed == null && attempt < 150)
  {
    await Task.Delay(TimeSpan.FromSeconds(1));

    attempt = attempt + 1;

    return RedirectToActionPreserveMethod(actionName: "WaitUntilDone", routeValues: new
    {
      taskId = task.TaskId.Value,
      attempt = attempt
    });
  } 
  else if (task.Completed == null && attempt >= 150)
  {
    response.Error = "Search request has timed out";
    return Ok(response);
  }

  response.Error = task.Error;
  response.CaseList = task.ResultCaseList?.Select(x=>x.ToResponseDto()).ToList();
  response.ResultSource = task.ResultSource;

  return Ok(response);
}

```

Body:  
{  
“region”: “gastage”,  
“location”: “rockdale:sca”,  
“firstName”: “ABC”,  
“lastName”: “EFG”,  
“bName”: “GA DHS”,  
“search”:true  
}

_Details (like screenshots)_:

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/b/bc55b424fa2ade591adef79317c26eafc3d2c702.png)

---

<div class="post-metadata">

**Author:** ![descent-module-cosm1](https://avatars.discourse-cdn.com/v4/letter/d/977dab/32.png) [@descent-module-cosm1](https://community.postman.com/u/descent-module-cosm1)\
**Post date:** [January 13, 2022, 4:18pm UTC](https://community.postman.com/t/error-exceeded-maxredirects-probably-stuck-in-a-redirect-loop/31504/2 "2022-01-13T16:18:18Z")

</div>

Didn’t know about the field “Maximum number of redirects” under Settings. Default value was 10. Changing that fixed it.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/f/a/fa26746afa95c0293004e0671f8a009fcc60af62.png)

---

<div class="post-metadata">

**Author:** ![saneja](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@saneja](https://community.postman.com/u/saneja)\
**Post date:** [May 19, 2022, 11:52am UTC](https://community.postman.com/t/error-exceeded-maxredirects-probably-stuck-in-a-redirect-loop/31504/3 "2022-05-19T11:52:28Z")

</div>

Even after increasing the “Maximum number of redirects” from settings , still getting the same error. can anyone please help ?

---

<div class="post-metadata">

**Author:** ![navigation-cosmonau4](https://avatars.discourse-cdn.com/v4/letter/n/db5fbb/32.png) [@navigation-cosmonau4](https://community.postman.com/u/navigation-cosmonau4)\
**Post date:** [December 23, 2022, 7:56pm UTC](https://community.postman.com/t/error-exceeded-maxredirects-probably-stuck-in-a-redirect-loop/31504/4 "2022-12-23T19:56:21Z")

</div>

Me too. Same problem following a Udemy Tutorial and doing a post to Postgresql/Node.js  
Error: Exceeded maxRedirects. Probably stuck in a redirect loop [http://localhost:3000/monsters](http://localhost:3000/monsters)  
The data posts 10 times (preset number of timeouts) and I get the error.  
If I remove the redirect it posts normally (1x) but it never finishes: Sending request…

router.post(“/”, (request, response, next) =\> {  
const { name, personality } = request.body;  
pool.query(  
“INSERT INTO monsters(name, personality) VALUES($1, $2)”,  
[name, personality],  
(err, res) =\> {  
if (err) return next(err);  
// response.redirect(“/monsters”); //this is not working! redirect lOOP.  
}  
);  
});

---

<div class="post-metadata">

**Author:** ![didierboka](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/didierboka/32/16284_2.png) [@didierboka](https://community.postman.com/u/didierboka)\
**Post date:** [July 11, 2023, 3:27am UTC](https://community.postman.com/t/error-exceeded-maxredirects-probably-stuck-in-a-redirect-loop/31504/5 "2023-07-11T03:27:39Z")

</div>

Please restart your network connection.

---

<div class="post-metadata">

**Author:** ![osorio.agustin](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/osorio.agustin/32/30582_2.png) [@osorio.agustin](https://community.postman.com/u/osorio.agustin)\
**Post date:** [October 31, 2024, 2:42am UTC](https://community.postman.com/t/error-exceeded-maxredirects-probably-stuck-in-a-redirect-loop/31504/6 "2024-10-31T02:42:44Z")

</div>

in my case, i was able to find the problem, for some reason the content type header was duplicated, just went ahead and deleted one of the instances and vuala!
