Skip to content

r0b0t3d/react-native-netify

Repository files navigation

react-native-netify

Native networking library for react native. Use AFNetworking for iOS and FastAndroidNetworking for Android.

Getting started

$ yarn add react-native-netify

Usage

import Netify from 'react-native-netify';

// Init module
Netify.init({
    // Set timeout for request
    timeout: 60000,
});

Netify.jsonRequest({
    url: apiUrl,
    method: 'post',
    headers: {
        'Content-Type': 'application/json'
    },
    body: {
        name: userName,
    }
})
.then(response => console.log(response))
.catch(error => {
    const { code, message, response } = error;
    console.log(code, message, response);
});