getweb
v0.0.2
Published
A lightweight, fast and not async request module.
Downloads
18
Readme
getweb
A lightweight, fast and not async request module.
You can go to the documentation by clicking here.
Basic Example
const gw = require("getweb");
/* == GET == */
let request1 = gw.get("https://example.com");
console.log(request1.body);
//To get the object format;
let request2 = gw.get("https://example.com", {
json: true,
});
console.log(request2.body);
/* == POST == */
let request3 = gw.post("https://example.com", {
data: {
message: "hello world",
},
});
console.log(request3.body);
//In a different way;
let request4 = gw.post("https://example.com", {
body: {
message: "hello world",
},
});
console.log(request4.body);
Other Examples
//HTML to JSON;
let request5 = gw.get("https://example.com", {
html: true,
json: true,
});
console.log(request5.body);
//XML to JSON;
let request6 = gw.get("https://example.com", {
xml: true,
json: true,
});
console.log(request6.body);
//JQuery mode;
let $ = gw.get("https://example.com", {
jquery: true,
});
console.log($);
console.log($("div#id"));