cross-fetch icon indicating copy to clipboard operation
cross-fetch copied to clipboard

Use node-fetch options on-demand

Open undergroundwires opened this issue 4 years ago • 0 comments

I use node.js successfully on client side, but on same project I'd also love to use cross-fetch using node-fetch options.

I would love to follow redirects, and it's not possible using WHATWG Fetch API but it's possible with node-fetch and follow option.

Reproduce in node:

  1. import fetch from 'cross-fetch';
  2. Call fetch with init argument that contains follow: 200 (node-fetch specific option)
  3. Node-fetch is called without follow: 200 option

I'm not sure if it's a bug report or feature request, but is there I way I can use it with options from node-fetch? I understand that the goal is to support WHATWG Fetch API, but should we strip down functionality that's already there? Or would you suggest any other solution for following redirects?

Thank you for maintaining this clean and magical library, I've seen using it successfully in privacy.sexy successfully and would love to continue doing it

undergroundwires avatar Oct 27 '21 19:10 undergroundwires