0.0.3 • Published 4 years ago

@rapharacing/request v0.0.3

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
4 years ago

Request

MIT License

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.

0.0.3

4 years ago

0.0.1

5 years ago