@schirrel/request
v1.3.0
Published
A simple wrapper for fetch api
Downloads
8
Readme
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.
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