Examples
banshee/examples-collection/examples/protocols/
http-get-account
Example: http.get with user= and password=, an optional account in Basic.
par banshee1 installation1 version
Publiée le 27 octobre 2026. First version in this collection.
Protocol: http.get with an account
user= and password= send an account in Basic. Here the account is optional: one collector serves a page with an account and a page without.
How to read it
need('protocol:http:user', 'optional'): a standard variable of banshee, set in the tree, here optional. Unset, it reads''.- An account is never sent by itself: the call names it,
user=$user, password=$password. Auserthat reads''sends no account, so the line needs no condition. protocol:http:passwordis a secret: it goes into a call, never into a value or a message. Passed tovalueorfail, the validation refuses it; sent overhttp://, it stops the collector. Usehttps://.- The answer is not a secret: the password went in a header.
To adapt it
- An API that wants a token instead:
need('protocol:http:token')andheaders=array('Authorization' => 'Bearer ' . $token).