0.1.2 • Published 8 years ago

noflo-http v0.1.2

Weekly downloads
3
License
-
Repository
github
Last release
8 years ago

HTTP for NoFlo

Build Status npm version

This package provides utility components to create HTTP/HTTPS clients in the NoFlo Node.js runtime. Based on HTTP and HTTPS for Node.js

Package Installation

npm install noflo-http --save

Component Usage

ConfigRequest

Create an object with a few request properties

PortNameDatatypeDescription
InPorthrefstringString specifying the URL for the request. It should be of the form '<protocol>://<hostname>:<port>/<path>?<query>'. It supports http and https protocols
InPortmethodstringString specifying the request method. Defaults to 'GET'
OutPorturlobjectObject with request properties

You can use noflo-objects to add more properties to the url object.

Headers

Add Headers to the URL object

PortNameDatatypeDescription
InPorturlobjectObject with request properties
InPortheadersstringString specifying the request headers. It should be of the form '{"<field_name>":"<value>" [, ...]}' Defaults to '{}'
OutPortoutobjectObject with request properties and headers

ReceiveResponse

On response event

PortNameDatatypeDescription
InPortrequestobjectObject with request parameters
OutPortresponsestringRaw data received from the server
OutPortmessagestringPayload of the data received from the server

SendRequest

Send request

PortNameDatatypeDescription
InPorturlallobject or string. If it is an object, this should have the properties described here. (You can use the ConfigRequest component to build an url object with a few basic properties). If it is a string, this should be of the form '<protocol>://<hostname>:<port>/<path>?<query>'. Supports http and https protocols
InPortdatabangData to write in the body of the request
InPortstartbangSignal to send the request
OutPortrequestobjectObject with request parameters

Examples

NameGistFlowhub
HTTP GET Clientcodeexample