Request

A simple promisse based and single file wrapper for new comers start to use Fetch API.

Installing

Just import the Request.js file.

Or install with npm:
npm i @schirrel/request

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) => {
            });
        

Look into source files and your console so see some examples ;)

If it helps you, gives Alan a hi!