1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Allow msg.PATCH method on http request node

Simple fix  to Close PR #524
(no CLA)
This commit is contained in:
dceejay 2015-01-30 09:59:36 +00:00
parent e9f0877da8
commit f451d0644a
2 changed files with 2 additions and 2 deletions

View File

@ -132,7 +132,7 @@
<ul>
<li><code>url</code>, if set, is used as the url of the request. Must start with http: or https:</li>
<li><code>method</code>, if set, is used as the HTTP method of the request.
Must be one of <code>GET</code>, <code>PUT</code>, <code>POST</code> or <code>DELETE</code> (default: GET)</li>
Must be one of <code>GET</code>, <code>PUT</code>, <code>POST</code>, <code>PATCH</code> or <code>DELETE</code> (default: GET)</li>
<li><code>headers</code>, if set, should be an object containing field/value
pairs to be added as request headers</li>
<li><code>payload</code> is sent as the body of the request</li>

View File

@ -203,7 +203,7 @@ module.exports = function(RED) {
}
var payload = null;
if (msg.payload && (method == "POST" || method == "PUT") ) {
if (msg.payload && (method == "POST" || method == "PUT" || method == "PATCH" ) ) {
if (typeof msg.payload === "string" || Buffer.isBuffer(msg.payload)) {
payload = msg.payload;
} else if (typeof msg.payload == "number") {