@rapharacing/request
v0.0.3
Published
Request wrapper for axios
Downloads
3
Readme
Request
Installation
Using npm:
npm i @rapharacing/request --save
Using Yarn:
yarn add @rapharacing/request
How to use
JavaScript
If the project supports ECMAScript Modules, you can use the import
syntax
import request, { get, post, put, patch, remove } from "@rapharacing/request";
const requestUsers = async () => {
const config = {
method: "get",
url: "/users"
};
const res = await request(config);
const { data } = res.data;
return data;
};
const requestUsers = async () => {
const res = await get("/users");
const { data } = res.data;
return data;
};
const postUser = async user => {
const res = await post("/user", user);
const { data } = res.data;
return data;
};
License
Request is freely distributable under the terms of the MIT license.