axios-case-converter-updated
Axios transformer/interceptor that converts snake_case/camelCase
- Converts outgoing
data
params
object keys into snake_case - Converts incoming
data
object keys into camelCase - Converts outgoing
headers
object keys into Header-Case - Converts incoming
headers
object keys into camelCase
Usage
You can fully use camelCase.
;; async { const client = ; const data = await client; console;};
Attention
FormData
compatibility
If you use FormData
on Internet Explorer or Safari, you need polyfill of FormData.prototype.entries()
.
If you use FormData
on React Native, please ignore the following warnings after confirming that polyfill is impossible.
// RN >= 0.52;YellowBox; // RN < 0.52consoleignoredYellowBox = 'Be careful that FormData cannot be transformed on React Native.';
Symbol
compatibility
If you use React Native for Android development, you should use Symbol polyfill from core-js
to avoid bugs with iterators:
- Create
polyfill.js
in root directory with code:
globalSymbol = ;;
- Include
polyfill.js
in entry point of your app (e.g.app.js
):
; // ... if PlatformOS === 'android' ;