MaxToyberman / react-native-ssl-pinning

React Native ssl pinning and cookies handling based on okhttp3 on (Android). and AFNetworking on (iOS)
MIT License
336 stars 101 forks source link

Interface is not the same as browser's fetch #186

Open homersimpsons opened 1 year ago

homersimpsons commented 1 year ago

This library seem to be almost the only drop-in replacement for fetch with support for ssl pinning.

It does not follow exactly the normal fetch function and thus is not exactly a drop-in replacement for fetch.

The current signature is:

function fetch(url: string, options: ReactNativeSSLPinning.Options): Promise<ReactNativeSSLPinning.Response>

While the normal fetch can receive a Request object as first parameter: https://developer.mozilla.org/en-US/docs/Web/API/fetch

How hard would it be to convert it to the same layout ?