My base issue is that I want to treat the query string from a redirect header as a dictionary. The sandbox documentation says that it supports the url package.
However, when I try to new up a URL object, it says ReferenceError: URL is not defined. I can use the legacy url.parse function, but that doesn’t get me access to the URLSearchParams class.
I tried the following code in both Postman and the Nodejs playground in Katacoda. Postman of course throws the above error, but it works in Katacoda.
const url = require('url');
u = new URL('https://foo.com?bar=baz');
console.log(u);
I’m a noob at js, so I’m sure this is just some basic thing I don’t know about. I’m really hoping that this isn’t an undocumented incompatibility.