then-request
Advanced tools
Comparing version 1.0.5 to 1.1.0
@@ -59,4 +59,4 @@ 'use strict'; | ||
headers: options.headers, | ||
followRedirects: true, | ||
gzip: true, | ||
followRedirects: options.followRedirects !== false, | ||
gzip: options.gzip !== false, | ||
cache: options.cache | ||
@@ -63,0 +63,0 @@ }, function (err, res) { |
{ | ||
"name": "then-request", | ||
"version": "1.0.5", | ||
"version": "1.1.0", | ||
"description": "A request library that returns promises, inspired by request", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -40,6 +40,8 @@ # then-request | ||
- `cache` - only used in node.js (browsers already have their own caches) Can be `'memory'`, `'file'` or your own custom implementaton (see https://github.com/ForbesLindesay/http-basic#implementing-a-cache). | ||
- `followRedirects` - defaults to `true` but can be explicitly set to `false` on node.js to prevent then-request following redirects automatically. | ||
- `gzip` - defaults to `true` but can be explicitly set to `false` on node.js to prevent then-request automatically supporting the gzip encoding on responses. | ||
**Callback / Returns:** | ||
If a callback is provided it is called with `err` and `res`. If no callback is provided, a [Promise](https://www.promisejs.org/) is returned that eventually resolves to `res`. The resulting Promise also has an additional `.getBody(encoding?)` method that is equivallent to calling `.then(function (res) { return res.getBody(); })`. | ||
If a callback is provided it is called with `err` and `res`. If no callback is provided, a [Promise](https://www.promisejs.org/) is returned that eventually resolves to `res`. The resulting Promise also has an additional `.getBody(encoding?)` method that is equivallent to calling `.then(function (res) { return res.getBody(encoding?); })`. | ||
@@ -46,0 +48,0 @@ ### Response |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18767
73