Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

request-promise

Package Overview
Dependencies
Maintainers
6
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request-promise - npm Package Compare versions

Comparing version 4.2.2 to 4.2.3

2

lib/rp.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc