Skip to content

Latest commit

 

History

History
60 lines (54 loc) · 1.45 KB

http.md

File metadata and controls

60 lines (54 loc) · 1.45 KB

HTTP/S Input

Fetch data from an http url, using GET method

Examples

Fetch every 2 seconds, with basic authentication

"inputs" : {
	"httpauth" : {
		"type" : "http",
		"config" : {
			"url" : "https://jigsaw.w3.org/HTTP/Basic/",
			"interval" : 2000,
			"options" : {
				"auth" : {
					"user" : "guest",
					"password" : "guest"
				}
			}
		}
	}
}

HTTPS JSON REST service

"inputs" : {
	"httprest" : {
		"type" : "http",
		"config" : {
			"url" : "https://jsonplaceholder.typicode.com/todos/1",
			"interval" : 2000,
			"options" : {},
			"tls" : {
				"rejectUnauthorized" : false
			}
		}
	},
}

Configuration parameters

  • url : HTTP Fetch URL.
  • interval : Number of milliseconds to fetch next data. Note that if not specified, this input behaves as a pull input (data will be fetched when the flow requires it), and, if set, then will behave as a push input (data will be fetched on an interval basis)
  • options : Options passed to the HTTP Client, as described in Request module
  • tls : TLS options as described in NodeJS documentation

Output

Each http call will generate an object with the following schema:

{
	id : '<input ID>',
	type : 'http',
	url : '<URL>',
	statusCode : '<HTTP status code>',
	headers : '<Response Headers>',
	originalMessage : '<raw data>'
}