This commit is contained in:
22
node_modules/request-light/README.md
generated
vendored
22
node_modules/request-light/README.md
generated
vendored
@@ -1,22 +0,0 @@
|
||||
# request-light
|
||||
|
||||
|
||||
[](https://www.npmjs.org/package/request-light)
|
||||
[](https://npmjs.org/package/request-light)
|
||||
[](https://github.com/microsoft/node-request-light/workflows/Tests)
|
||||
[](https://opensource.org/licenses/MIT)
|
||||
|
||||
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.
|
||||
|
||||
```ts
|
||||
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());
|
||||
});
|
||||
```
|
||||
Reference in New Issue
Block a user