To get the redirected URL from the Node request module, we use the request
property.
For instance, we write
const request = require("request");
const r = request.get("http://example.com", (err, res, body) => {
console.log(res.request.uri.href);
});
to make a get request with request.get
.
We get the redirect URL from the res.request.url.href
property.