@schirrel/request

1.3.0 • Public • Published

Request

A simple promise based and single file wrapper for newers to start using Fetch API.

For those who dont want a big library to simple requests, and yet want to simplify the fetch use.

npm version

Installing

Just import the Request.js file or run npm i @schirrel/request.

Examples

See Example Folder

GET

Request.get("https://jsonplaceholder.typicode.com/todos/1")
.then((res) => {})
.catch((err) => {});

POST

Request.post('https://jsonplaceholder.typipre.com/posts', {
    body: {
        title:'Ahoy'
    }
})
.then((res) => {})
.catch((err) => {});

PUT

Request.put('https://jsonplaceholder.typicode.com/posts/1', {
body: {
   id:1,
   title:'Ahoy'
    }
 })
.then((res) => {})
.catch((err) => {});

DELETE

Request.delete('https://jsonplaceholder.typicode.com/posts/1')
.then((res) => {})
.catch((err) => {});

For a http client you can also check api-request current under development

Readme

Keywords

Package Sidebar

Install

npm i @schirrel/request

Weekly Downloads

4

Version

1.3.0

License

MIT

Unpacked Size

10.4 kB

Total Files

7

Last publish

Collaborators

  • schirrel