Http In
Creates an HTTP end-point for creating web services.
Outputs
For a GET request, contains an object of any query string parameters. Otherwise, contains the body of the HTTP request.
An HTTP request object. This object contains multiple properties that provide information about the request.
-
- the body of the incoming request. The format will depend on the request.
-
- an object containing the HTTP request headers.
-
- an object containing any route parameters.
-
- an object containing the cookies for the request.
-
- if enabled within the node, an object containing any files uploaded as part of a POST request.
An HTTP response object. This property should not be used directly; the HTTP Response
node documents how to respond to a request. This property must remain attached to the message passed to response node.
The node will listen on the configured path for requests of a particular type. The path can be fully specified, such as user/
, or include named parameters that accept any value, such as /user/:name
. When named parameters are used, their actual value in a request can be accessed under msg.req.params
.
For request that include a body, such as a POST or PUT, the contents of the request is made available as msg.payload
.
If the content type of the request can be determined, the body will be parsed to any appropriate type. For example, application/json
will be parsed to its JavaScript object representation.
Note: this node does not send any response to the request. The follow must include an HTTP Response node to complete the request.
Usage example:
Source:
Http Request
Sends HTTP requests and returns the response.
Inputs
If not configured in the node, this optional property sets the url of the request.
If not configured in the node, this optional property sets the HTTP method of the request. Must be one of GET
, PUT
, POST
, PATCH
or DELETE
.
Sets the HTTP headers of the request.
If set, can be used to send cookies with the request.
Sent as the body of the request.
If set to false
, allows requests to be made to https sites that use self signed certificates.
If set to false
prevent following Redirect(HTTP 301). true
by default.
If set to a positive number of milliseconds, will override the globally set httpRequestTimeout
parameter.
Outputs
The body of the response. The node can be configured to return the body as a string, attempt to parse it as a JSON string or leave it as a binary buffer.
The status code of the response, or the error code if the request could not be completed.
An object containing the response headers.
In case any redirects occurred while processing the request, this property is the final redirected url. Otherwise, the url of the original request.
If the response includes cookies, this property is an object of name/value pairs for each cookie.
If the request was redirected one or more times, the accumulated information will be added to this property. 'location' is the next destination. 'cookies' is the cookies returned from the redirect souce.
Usage example:
Source: