Losing my mind trying to get fetch or axios or superagent or anything in React Native to not follow redirects. About to give up and write my own Obj-C or Swift networking bridge.

Vincent

you could look at writing an interceptor. Check this thread, specifically the last answer.

Seems axios has an option for maxRedirects but that won’t work with React Native.

Manton Reece

@vincent This seems to be a limitation in every library. Most are just wrappers for fetch or XMLHttpRequest anyway, which are documented to not support manual redirects in React Native. Going with another work-around for now.

Al Power

not the same but this came up in my feed and thought you’d be tangentially interested swiftrocks.com/how-async...

Manton Reece

@alpower Cool, thanks for the link.

Manton Reece @manton
Lightbox Image