package
async-request is a wrapper for request that uses ES7 async functions.
npm install async-requestGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
async-request is a wrapper for request that uses ES7 async functions.
let request = require('async-request'),
response;
try {
response = await request('http://gajus.com/');
// response.statusCode
// response.headers
// response.body
await request('http://gajus.com', {
// This example demonstrates all of the supported options.
// Request method (uppercase): POST, DELETE, ...
method: 'POST',
data: {
foo: 'bar'
},
headers: {
foo: 'bar'
},
proxy: 'http://127.0.0.1:8000',
// To create a new cookie jar.
async-request does not provide (expose) inbuilt debugging capabilities. Use a proxy (e.g. https://mitmproxy.org/) to intercept and analyze HTTP traffic.
Async function behavior has been accepted into stage 1 ("Proposal") of the ECMASCript 7 spec process in January 2014. This means that it cannot be used out of the box with node.js or iojs without a transpiler.
This library is using Babel to compile ES7 code into ES5. Refer to the ./gulpfile.js.
This library has been created as part of ES7 async function proposal research. It covers basic use of request. I do not advise to use it in production, though I will be testing it in several private projects and update as I go – contributions are welcome too.
Estimated unpacked size across 37 packages.
7.8 MB
Includes dependencies.
3 direct · 2 outdated