react-rest-client
Consuming REST APIs the React way.
Installation
React Rest Client requires React 0.15 or later.
Using npm
npm install --save react-rest-client
Using yarn
yarn add react-rest-client
Usage
The Basics
React Rest Client borrows many ideas from React Router in terms of syntax. Here is an example of consuming a simple Todo backend API.
Single Endpoint
import React Component from 'react'import Client Endpoint middleware from 'react-rest-client' const onEnter = { ifeventkey === 'Enter' } { return <Client ='http://example.com'> <Endpoint ='todos' = = /> </Client> }
Multiple Endpoints
import React Component from 'react'import Client Endpoints middleware from 'react-rest-client' const onEnter = { ifeventkey === 'Enter' } { return <Client ='https://example.com'> <Endpoint = = /> </Client> }