Http

HTTP

This filter allows you to send HTTP requests. When a Message arrives to the filter, we can decide if use the main field of the Message as URL on the request, or its content for the HTTP data.
This behaviour can be handled with the parameters.

Parameters

ParameterTypeDefaultDescription
urlSTRINGemptyURL of the web page. It is possible use the Golang templates to use fields of the Message
download_toSTRINGemptypath of where to download the file. It is possible use the Golang templates to use fields of the Message
text_onlyBOOL“false”if “true” it removes all the tags from the body response
methodSTRING“GET”HTTP method to use on the request
headersJSONemptyHeaders to use in the request
dataJSONemptyPOST fields to send with the request (it’s not possible to use in combination with rawData)
rawDataSTRINGemptyraw body of the request (it’s not possible to use in combination with data)
statusSTRINGemptythe filter will propagate the Message only if the returned status has the specified value
cookiesSTRINGemptyPath of the JSON file containing the cookies to use
... | http(url="{{ .main }}", cookies="exported.json", headers="{\"Content-type\": \"application/json\"}") | ...

Output

If the request was successful, the output Message will have the main field set to the HTTP body response. If the status is set, and the response http status is different from it, the Message will be dropped.

The Message is dropped if the request is failed.

Examples

What's on this Page