Warning: This library is only used in front
npm install @farpat/api
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;