A package that handles GET and POST requests
Now works with version
1.1.2
of@protagonists/coerce
The content may not correspond to the object structure of the objects
This package makes it easier to use and handle basic web requests
npm install @protagonists/request
const { Get, Post } = require("@protagonists/request")();
const { Get, Post } = require("@protagonists/https")();
Get({
host: "csrng.net",
path: "csrng/csrng.php?min=0&max=100"
}).then(console.log);
{
path: '/csrng/csrng.php?min=0&max=100',
method: 'GET',
content: [ { status: 'success', min: 0, max: 100, random: 33 } ],
headers: {
date: 'Fri, 10 Jun 2022 18:51:27 GMT',
server: 'Apache/2.4.37 (Red Hat Enterprise Linux) OpenSSL/1.1.1k',
'x-powered-by': 'PHP/7.4.29',
connection: 'close',
'transfer-encoding': 'chunked',
'content-type': 'application/json; charset=utf-8'
},
status: { code: 200, message: 'OK' }
}