New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-native-simple-fetch

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-simple-fetch

A simpler implementation of `fetch` for React Native.

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

react-native-simple-fetch

A partial yet simpler implementation of the fetch API for React Native. Currently iOS only.

Install

  1. Run npm install --save liaoyuan-io/react-native-simple-fetch .

  2. Add RCTSimpleFetch.xcodeproj to your iOS project.

  3. Add libRCTSimpleFetch.a to your Link Binary with Libraries section in Build Phases .

Usage

import {fetch} from 'react-native-simple-fetch';

fetch("http://api.blahblah.com/msg/123123123", {
    method: 'put',          // upper or lower case
    headers: {
        'Content-Type': 'application/json; charset=UTF-8',
        'Accept': 'application/json',
        'User-Agent': 'SuperGreatApp/1.0',
    },
    body: '{"msg": "This is body, possibly text or JSON."}',
    gzipRequest: true       // Will compress request with gzip.
}).then((res)=>{
    console.log("Is OK? ", res.ok);
    console.log("Status Code: ", res.status);
    return res.json();      // or `res.text();`
}).then((obj)=>{
    console.log("Response object is: ", obj);
});

FAQs

Package last updated on 16 Aug 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc