getweb
A lightweight, fast and not async request module.
You can go to the documentation by clicking here.
Basic Example
const gw = require("getweb");
let request1 = gw.get("https://example.com");
console.log(request1.body);
let request2 = gw.get("https://example.com", {
json: true,
});
console.log(request2.body);
let request3 = gw.post("https://example.com", {
data: {
message: "hello world",
},
});
console.log(request3.body);
let request4 = gw.post("https://example.com", {
body: {
message: "hello world",
},
});
console.log(request4.body);
Other Examples
let request5 = gw.get("https://example.com", {
html: true,
json: true,
});
console.log(request5.body);
let request6 = gw.get("https://example.com", {
xml: true,
json: true,
});
console.log(request6.body);
let $ = gw.get("https://example.com", {
jquery: true,
});
console.log($);
console.log($("div#id"));