From aa7fe3668c32425872a639e7e6f3fb4b716bd5b1 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Tue, 27 Jun 2017 14:58:13 +0100 Subject: [PATCH] HTTP Request node: add info on how to do form encoding --- nodes/core/io/21-httprequest.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/nodes/core/io/21-httprequest.html b/nodes/core/io/21-httprequest.html index b910b6bd6..03cf5b73e 100644 --- a/nodes/core/io/21-httprequest.html +++ b/nodes/core/io/21-httprequest.html @@ -112,13 +112,19 @@

In order to use more than one of these nodes in the same flow, care must be taken with the msg.headers property. The first node will set this property with the response headers. The next node will then use those headers for its request - this - is not usually the right thing to do. The msg.headers property must - be deleted with a change node in order for the requests to work as expected.

+ is not usually the right thing to do. If msg.headers property is left unchanged + between nodes, it will be ignored by the second node. To set custom headers, msg.headers + should first be deleted or reset to an empty object: `{}`.

Cookie handling

The cookies property passed to the node must be an object of name/value pairs. The value can be either a string to set the value of the cookie or it can be an object with a single value property.

Any cookies returned by the request are passed back under the responseCookies property.

+

Content type handling

+

If msg.payload is an Object, the node will automatically set the content type + of the request to application/json and encode the body as such.

+

To encode the request as form data, msg.headers["content-type"] should be set to application/x-www-form-urlencoded.

+