request-promise
Advanced tools
Comparing version 4.2.2 to 4.2.3
@@ -21,3 +21,3 @@ 'use strict'; | ||
/* istanbul ignore next */ | ||
console.error(EOL + '###' + EOL + '### The "request" library is not installed automatically anymore.' + EOL + '### But required by "request-promise".' + EOL + '###' + EOL + '### npm install request --save' + EOL + '###' + EOL); | ||
console.error(EOL + '###' + EOL + '### The "request" library is not installed automatically anymore.' + EOL + '### But is a dependency of "request-promise".' + EOL + '### Please install it with:' + EOL + '### npm install request --save' + EOL + '###' + EOL); | ||
/* istanbul ignore next */ | ||
@@ -24,0 +24,0 @@ throw err; |
{ | ||
"name": "request-promise", | ||
"version": "4.2.2", | ||
"version": "4.2.3", | ||
"description": "The simplified HTTP request client 'request' with Promise support. Powered by Bluebird.", | ||
@@ -36,6 +36,6 @@ "keywords": [ | ||
"dependencies": { | ||
"request-promise-core": "1.1.1", | ||
"request-promise-core": "1.1.2", | ||
"bluebird": "^3.5.0", | ||
"stealthy-require": "^1.1.0", | ||
"tough-cookie": ">=2.3.3" | ||
"stealthy-require": "^1.1.1", | ||
"tough-cookie": "~2.3.3" | ||
}, | ||
@@ -42,0 +42,0 @@ "peerDependencies": { |
@@ -139,3 +139,3 @@ <a href="http://promisesaplus.com/"> | ||
Set `options.formData` to your data to encode the body the same way as HTML forms do. | ||
Pass your data to `options.form` to encode the body the same way as HTML forms do: | ||
@@ -146,5 +146,29 @@ ``` js | ||
uri: 'http://posttestserver.com/post.php', | ||
form: { | ||
// Like <input type="text" name="name"> | ||
name: 'Josh' | ||
}, | ||
headers: { | ||
/* 'content-type': 'application/x-www-form-urlencoded' */ // Is set automatically | ||
} | ||
}; | ||
rp(options) | ||
.then(function (body) { | ||
// POST succeeded... | ||
}) | ||
.catch(function (err) { | ||
// POST failed... | ||
}); | ||
``` | ||
If you want to include a file upload then use `options.formData`: | ||
``` js | ||
var options = { | ||
method: 'POST', | ||
uri: 'http://posttestserver.com/post.php', | ||
formData: { | ||
// Like <input type="text" name="name"> | ||
name: 'test.jpg', | ||
name: 'Jenn', | ||
// Like <input type="file" name="file"> | ||
@@ -160,3 +184,3 @@ file: { | ||
headers: { | ||
/* 'content-type': 'application/x-www-form-urlencoded' */ // Is set automatically | ||
/* 'content-type': 'multipart/form-data' */ // Is set automatically | ||
} | ||
@@ -259,2 +283,3 @@ }; | ||
- `rp(...).catch(...)` or e.g. `rp.del(...).catch(...)` which is the same method as provided by Bluebird promises | ||
- Errors that the `request` library would pass to the callback are wrapped by `request-promise` and then passed to the catch handler. See [code example](https://github.com/request/request-promise#thenonfulfilled-onrejected) below. | ||
- `rp(...).finally(...)` or e.g. `rp.put(...).finally(...)` which is the same method as provided by Bluebird promises | ||
@@ -627,2 +652,6 @@ - `rp(...).cancel()` or e.g. `rp.get(...).cancel()` which cancels the request | ||
- v4.2.3 (2019-02-14) | ||
- Using stricter `tough-cookie@~2.3.3` to avoid installing `tough-cookie@3` which introduces breaking changes | ||
*(Thanks to @aomdoa for pull request [#299](https://github.com/request/request-promise/pull/299))* | ||
- Security fix: bumped `lodash` to `^4.17.11`, see [vulnerabilty reports](https://snyk.io/vuln/search?q=lodash&type=npm) | ||
- v4.2.2 (2017-09-22) | ||
@@ -629,0 +658,0 @@ - Upgraded `tough-cookie` to a version without regex DoS vulnerability |
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
36327
746
+ Addedpunycode@1.4.1(transitive)
+ Addedrequest-promise-core@1.1.2(transitive)
+ Addedtough-cookie@2.3.4(transitive)
- Removedrequest-promise-core@1.1.1(transitive)
- Removedtldts@6.1.61(transitive)
- Removedtldts-core@6.1.61(transitive)
- Removedtough-cookie@5.0.0(transitive)
Updatedrequest-promise-core@1.1.2
Updatedstealthy-require@^1.1.1
Updatedtough-cookie@~2.3.3