Comparing version 2.0.0 to 2.1.0
17
index.js
@@ -25,2 +25,9 @@ 'use strict'; | ||
var body = opts.body; | ||
delete opts.body; | ||
if (body && opts.method === undefined) { | ||
opts.method = 'POST'; | ||
} | ||
// returns a proxy stream to the response | ||
@@ -51,3 +58,3 @@ // if no callback has been provided | ||
var req = fn.get(arg, function (response) { | ||
var req = fn.request(arg, function (response) { | ||
var statusCode = response.statusCode; | ||
@@ -94,2 +101,10 @@ var res = response; | ||
} | ||
if (!body) { | ||
req.end(); | ||
return; | ||
} | ||
req.write(body); | ||
req.end(); | ||
}; | ||
@@ -96,0 +111,0 @@ |
{ | ||
"name": "got", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"description": "Simplified HTTP/HTTPS requests", | ||
@@ -36,3 +36,3 @@ "license": "MIT", | ||
"read-all-stream": "^0.1.0", | ||
"timed-out": "^1.0.0" | ||
"timed-out": "^2.0.0" | ||
}, | ||
@@ -39,0 +39,0 @@ "devDependencies": { |
@@ -60,2 +60,8 @@ # got [![Build Status](https://travis-ci.org/sindresorhus/got.svg?branch=master)](https://travis-ci.org/sindresorhus/got) | ||
##### options.body | ||
Type: `string`, `Buffer` | ||
Body, that will be sent with `POST` request. If present in `options` and `options.method` is not set - `options.method` will be set to `POST`. | ||
##### options.timeout | ||
@@ -62,0 +68,0 @@ |
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
5138
91
95
+ Addedtimed-out@2.0.0(transitive)
- Removedtimed-out@1.0.0(transitive)
Updatedtimed-out@^2.0.0