@farpat/api
v2.1.0
Published
A http client for JavaScript
Readme
Warning: This library is only used in front
Installation
npm install @farpat/api
Use
You can use verb " GET, POST, PUT, PATCH and DELETE ". Here are some examples of use :
import {jsonGet, jsonPost} from "@farpat/api";
jsonGet(
'/path/to/resource',
{query_string:'value'},
{header:'value'}
)
.then()
.catch()
jsonPost(
'/path/to/resource',
{key: 'value'}, //or FormData
{header: 'value'}
)
.then()
.catch()
// and " put, patch, delete " verbs;