Comparing version 1.2.2 to 1.2.3
@@ -20,3 +20,3 @@ const { request: https } = require('https'); | ||
* @param {number} [options.timeout] The timeout after which the request should fail. | ||
* @param {string} [options.method="POST"] What HTTP method to use to send data. Default `POST`. | ||
* @param {string} [options.method] What HTTP method to use in making of the request. When no method is given and `data` is present, defaults to `POST`. | ||
* @param {boolean} [options.binary=false] Whether to return a buffer instead of a string. Default `false`. | ||
@@ -35,4 +35,4 @@ * @param {boolean} [options.justHeaders=false] Whether to stop the request after response headers were received, without waiting for the data. Default `false`. | ||
binary = false, | ||
method = 'POST', | ||
justHeaders = false, | ||
method, | ||
timeout, | ||
@@ -54,2 +54,3 @@ } = options | ||
timeout, | ||
method, | ||
} | ||
@@ -63,3 +64,3 @@ | ||
opts.method = method | ||
opts.method = method || 'POST' | ||
opts.headers['Content-Type'] = contentType | ||
@@ -104,3 +105,3 @@ opts.headers['Content-Length'] = Buffer.byteLength(data) | ||
* @prop {number} [timeout] The timeout after which the request should fail. | ||
* @prop {string} [method="POST"] What HTTP method to use to send data. Default `POST`. | ||
* @prop {string} [method] What HTTP method to use in making of the request. When no method is given and `data` is present, defaults to `POST`. | ||
* @prop {boolean} [binary=false] Whether to return a buffer instead of a string. Default `false`. | ||
@@ -107,0 +108,0 @@ * @prop {boolean} [justHeaders=false] Whether to stop the request after response headers were received, without waiting for the data. Default `false`. |
## 3 February 2019 | ||
### 1.2.3 | ||
- [fix] Set the method when no data is given. | ||
### 1.2.2 | ||
@@ -4,0 +8,0 @@ |
{ | ||
"name": "@rqt/aqt", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "An Advanced Network Request Package That Returns Body (Parsed As JSON If Needed), Headers And Status After Gzip Decompression.", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
@@ -51,3 +51,3 @@ # @rqt/aqt | ||
| timeout | _number_ | The timeout after which the request should fail. | - | | ||
| method | _string_ | What HTTP method to use to send data. | `POST` | | ||
| method | _string_ | What HTTP method to use in making of the request. When no method is given and `data` is present, defaults to `POST`. | - | | ||
| binary | _boolean_ | Whether to return a buffer instead of a string. | `false` | | ||
@@ -69,3 +69,3 @@ | justHeaders | _boolean_ | Whether to stop the request after response headers were received, without waiting for the data. | `false` | | ||
"content-type": "text/plain", | ||
"date": "Sat, 02 Feb 2019 15:40:28 GMT", | ||
"date": "Sun, 03 Feb 2019 05:17:38 GMT", | ||
"connection": "close", | ||
@@ -72,0 +72,0 @@ "transfer-encoding": "chunked" |
@@ -20,3 +20,3 @@ import { request as https } from 'https' | ||
* @param {number} [options.timeout] The timeout after which the request should fail. | ||
* @param {string} [options.method="POST"] What HTTP method to use to send data. Default `POST`. | ||
* @param {string} [options.method] What HTTP method to use in making of the request. When no method is given and `data` is present, defaults to `POST`. | ||
* @param {boolean} [options.binary=false] Whether to return a buffer instead of a string. Default `false`. | ||
@@ -35,4 +35,4 @@ * @param {boolean} [options.justHeaders=false] Whether to stop the request after response headers were received, without waiting for the data. Default `false`. | ||
binary = false, | ||
method = 'POST', | ||
justHeaders = false, | ||
method, | ||
timeout, | ||
@@ -54,2 +54,3 @@ } = options | ||
timeout, | ||
method, | ||
} | ||
@@ -63,3 +64,3 @@ | ||
opts.method = method | ||
opts.method = method || 'POST' | ||
opts.headers['Content-Type'] = contentType | ||
@@ -104,3 +105,3 @@ opts.headers['Content-Length'] = Buffer.byteLength(data) | ||
* @prop {number} [timeout] The timeout after which the request should fail. | ||
* @prop {string} [method="POST"] What HTTP method to use to send data. Default `POST`. | ||
* @prop {string} [method] What HTTP method to use in making of the request. When no method is given and `data` is present, defaults to `POST`. | ||
* @prop {boolean} [binary=false] Whether to return a buffer instead of a string. Default `false`. | ||
@@ -107,0 +108,0 @@ * @prop {boolean} [justHeaders=false] Whether to stop the request after response headers were received, without waiting for the data. Default `false`. |
Sorry, the diff of this file is not supported yet
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
29213
458