@ayakashi/request
v2.88.7
Published
Simplified HTTP request client.
Downloads
35
Readme
Request - Simplified HTTP client
Fork of request
Includes the following:
- Adds Brotli support
- Bundles request-promise-native and uses Promises by default
- Bundles updated typescript definitions that use Promises
- Updates/removes some packages that have security vulnerabilities
Installing
npm install --save @ayakashi/request
Using Brotli
Just pass gzipOrBrotli: true
in the options instead of just gzip: true
const request = require("@ayakashi/request");
const body = await request.get('https://www.google.com', {
gzipOrBrotli: true
});
Using the callback-based interface
Require @ayakashi/request/core
instead of @ayakashi/request
.
Brotli is available here as well.
const request = require("@ayakashi/request/core");
request.get('https://www.google.com', {gzipOrBrotli: true}, function(err, resp, body) {
console.log(body);
});