A light weight nodejs request library with proxy support. Intended to be used by VSCode extensions
Перейти к файлу
microsoft-github-policy-service[bot] 0420619c3a
Microsoft mandatory file
2022-08-29 14:05:23 +00:00
.github update action 2021-07-12 16:26:44 +02:00
.vscode support binary, webpack outputs, update dependencies 2021-07-12 16:22:14 +02:00
build remove source map now done by webpack 2021-07-12 17:34:13 +02:00
polyfill support binary, webpack outputs, update dependencies 2021-07-12 16:22:14 +02:00
src fic typing of XHRConfigure 2022-04-12 15:03:27 +02:00
.gitignore fix gitignore 2016-04-18 15:13:50 +02:00
.npmignore support binary, webpack outputs, update dependencies 2021-07-12 16:22:14 +02:00
CHANGELOG.md support binary, webpack outputs, update dependencies 2021-07-12 16:22:14 +02:00
LICENSE.md fix gitignore 2016-04-18 15:13:50 +02:00
README.md Update README.md 2021-12-30 21:23:21 +01:00
SECURITY.md Microsoft mandatory file 2022-08-29 14:05:23 +00:00
api.d.ts fic typing of XHRConfigure 2022-04-12 15:03:27 +02:00
package-lock.json 0.5.8 2022-04-12 15:03:31 +02:00
package.json 0.5.8 2022-04-12 15:03:31 +02:00
webpack.config.js fix source maps 2022-01-07 14:16:59 +01:00

README.md

request-light

npm Package NPM Downloads Build Status

A lightweight request library intended to be used by VSCode extensions.

  • NodeJS and browser main entry points
  • proxy support: Use configure or HTTP_PROXY and HTTPS_PROXY env variables to configure the HTTP proxy addresses.
import { xhr, XHRResponse, getErrorStatusDescription } from 'request-light';

const headers = { 'Accept-Encoding': 'gzip, deflate' };
return xhr({ url: url, followRedirects: 5, headers }).then(response => {
    return response.responseText;
}, (error: XHRResponse) => {
    throw new Error(error.responseText || getErrorStatusDescription(error.status) || error.toString());
});