Examples
banshee/examples-collection/examples/protocols/
http-post
Example: http.post with a JSON body built by json.write; errors counted in a search index.
by banshee1 installation1 version
Published on October 27, 2026. First version in this collection.
Protocol: http.post
http.post sends a POST with a body, a text, and returns what http.get returns. Here, the count of the errors logged in the last 15 minutes, asked to an Elasticsearch or OpenSearch index.
How to read it
json.writebuilds the JSON body from arrays: the quotes, the@and the nesting are written for you.headers=array('Content-Type' => 'application/json'): the type of the body is a header the author writes.- What a
POSTdoes on the target is the author's judgement: this one only counts. Use an account that can only read. - A body that carries a secret makes the whole answer a secret, but its code and its time (see
examples/api/backup-jobs).
To adapt it
- The address names the index (
logs-*) and_count; change the query for the field and the value your logs use. - An account:
user=,password=(seeexamples/protocols/http-get-account).