'Convert Curl to JS/TS -X parameter

Hi whilist testing another part of code, I still can't find the solution. However:

curl -x "http://proxyaddress" -L "http://targetaddress"

Returns correct information, but I can't get it working in JS/Typescript. I'm using typescript with angular, but I can't get this proxy to work. What options should I set for this basic request?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source