I am writing a Node.js API to register a user to another web app. The problem is, during registration process, the API that the Node app requested with
301 redirected to another API to complete the registration.
This problem can be solved if I’m using jQuery AJAX and wait for the
.complete() callback to make sure the redirection is successful.
How can I accomplish this with Node.js
Apparently, it is caused by a redirect to a POST (non-GET) HTTP request, which is disabled by
request at default. I should’ve enabled this option to follow any kind of HTTP request:
Details in this link: Follow redirect with node.js request