# HTTP request node not following 302 redirect

**URL:** <https://discourse.nodered.org/t/http-request-node-not-following-302-redirect/16409>\
**Category:** General\
**Created:** [7 October 2019 08:08 UTC](https://discourse.nodered.org/t/http-request-node-not-following-302-redirect/16409 "2019-10-07T08:08:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![M-F-K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/m-f-k/32/12896_2.png) [@M-F-K](https://discourse.nodered.org/u/M-F-K)\
**Post date:** [7 October 2019 08:08 UTC](https://discourse.nodered.org/t/http-request-node-not-following-302-redirect/16409/1 "2019-10-07T08:08:11Z")

</div>

Hi,

Im a newbie to node-red and this forum, so if anything in this post sounds stupid or the post itself placed wrong, im sorry for wasting your time.

annyway my problem:

Im trying to to a post redirect to gain wunderlist access, as described here :

[https://developer.wunderlist.com/documentation/concepts/authorization](https://developer.wunderlist.com/documentation/concepts/authorization)

For a start I have hardcoded the url in the request node as:

Method : post  
URL : [https://www.wunderlist.com/oauth/authorize?client\_id=ID&redirect\_uri=URL&state=RANDOM](https://www.wunderlist.com/oauth/authorize?client_id=ID&redirect_uri=URL&state=RANDOM) (where ID and URL have been replaced )  
Return : UTF-8 String

If I try the url in a browser everything works (redirected to the url + a code in the url), but in node-red it gives me an httpcode 302 + the hardcoded url as the responseurl ??

I have tried to change this.followAllRedirects = false to this.followAllRedirects = true in redirect.js in the request module, but that did not work.

Any ideas on what im doing wrong?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [7 October 2019 08:29 UTC](https://discourse.nodered.org/t/http-request-node-not-following-302-redirect/16409/2 "2019-10-07T08:29:19Z")

</div>

“ The Wunderlist API uses [OAuth2](http://oauth.net/2/)”

Have you seen the examples in the  
node-red-contrib-oauth2 node?

> **[node-red-contrib-oauth2](https://flows.nodered.org/node/node-red-contrib-oauth2)**
>
> node-red-contrib-oauth2 - An OAuth2 client which sends an oauth2Response object as output.

---

<div class="post-metadata">

**Author:** ![M-F-K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/m-f-k/32/12896_2.png) [@M-F-K](https://discourse.nodered.org/u/M-F-K)\
**Post date:** [7 October 2019 09:52 UTC](https://discourse.nodered.org/t/http-request-node-not-following-302-redirect/16409/3 "2019-10-07T09:52:12Z")

</div>

yes, I installed the mentioned node earlier, but I could not figure it out, so I proceeded the "low-leveled way" instead with the http request node. But if this node can't process redirect, then im back to the Oauth2 node again.

a simple flow this this solution would then be the following:

inject node =\> function node =\> oauth2 node =\> debug node

where all the parameters is set on the msg object in the function node, - right ?

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [7 October 2019 10:06 UTC](https://discourse.nodered.org/t/http-request-node-not-following-302-redirect/16409/4 "2019-10-07T10:06:14Z")

</div>

Sorry, I've reread your initial post and I can't see where you mention the oauth node

The readme of the Oauth2 node includes a full worked example of a HTTP Request with basic authentication, which you can import.

---

<div class="post-metadata">

**Author:** ![M-F-K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/m-f-k/32/12896_2.png) [@M-F-K](https://discourse.nodered.org/u/M-F-K)\
**Post date:** [7 October 2019 10:13 UTC](https://discourse.nodered.org/t/http-request-node-not-following-302-redirect/16409/5 "2019-10-07T10:13:02Z")

</div>

didn't mentioned it before, you are right. will try to import the example and see where it leads me. Thank you for your help 👍

---

<div class="post-metadata">

**Author:** ![M-F-K](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/m-f-k/32/12896_2.png) [@M-F-K](https://discourse.nodered.org/u/M-F-K)\
**Post date:** [8 October 2019 11:07 UTC](https://discourse.nodered.org/t/http-request-node-not-following-302-redirect/16409/6 "2019-10-08T11:07:31Z")

</div>

small update:

tried importing the oauth2 flow examples, - and the first example is nearly identical to what i have been building ( trigger node and then a request node calling an https endpoint with client id and a redirect url ). The example use an http url (not https)....

been googling further, and it seems im not the only one with problem regarding POST HTTPS request not redirecting :

> <https://github.com/node-red/node-red/issues/2017>

seems I am stuck again, - will follow the github issue and see if something later on turns up 😐
