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
| Parameter | Type | Default | Description |
|---|---|---|---|
| url | STRING | empty | URL of the web page. It is possible use the Golang templates to use fields of the Message |
| download_to | STRING | empty | path of where to download the file. It is possible use the Golang templates to use fields of the Message |
| text_only | BOOL | “false” | if “true” it removes all the tags from the body response |
| method | STRING | “GET” | HTTP method to use on the request |
| headers | JSON | empty | Headers to use in the request |
| data | JSON | empty | POST fields to send with the request (it’s not possible to use in combination with rawData) |
| rawData | STRING | empty | raw body of the request (it’s not possible to use in combination with data) |
| status | STRING | empty | the filter will propagate the Message only if the returned status has the specified value |
| cookies | STRING | empty | Path 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
Soon…