When you initialize your Client, you can specify a few options. I'm not sure if any of them would be directly useful to you. When you initialize your Client, you can specify an options object:
The client is based on node-fetch, and proxyAgent refers to the agent option in that package. Let me know if that helps. (I'm not familiar with proxies, so this is just a guess.) If this doesn't address your use case, I can keep digging.
Best,
Sam
samlittlefair
(Sam Littlefair)
closed , flag & select 'Something Else' to reopen.
4
This issue has been closed due to inactivity. Flag to reopen.
The requestHandler option may be a better fit for your needs. It allows you to provide a custom function to fetch content from the API. With this, you can alter the URL and set custom request options, like headers.
In the example, you'll see we are setting a custom header named X-Custom-Header. The example also demonstrates that any fetch function can be used as long as you can call the callback function with the JSON result and the Response object. This allows you to modify the requested URL if necessary.
I'm not sure what your proxy needs are, but you should be able to modify the request property of the requestHandler option to do any kind of request interception needed.
Hope that helps!
Thanks,
Angelo
1 Like
system
(system)
closed as resolved, flag & select 'Something Else' to reopen.
11
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.