@ayakashi/request

Simplified HTTP request client.

Usage no npm install needed!

<script type="module">
  import ayakashiRequest from 'https://cdn.skypack.dev/@ayakashi/request';
</script>

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