banshee est en développement actif : les collecteurs vont encore changer, et une version que vous publiez demandera sans doute des ajustements. Pour un usage stable, attendez la version 1.0.0.

Examples

banshee/examples-collection/examples/protocols/

http-get-account

Example: http.get with user= and password=, an optional account in Basic.

  • example
  • protocol
  • http
  • account
  • basic

par banshee1 installation1 version

v1Dernière

Publiée le 27 octobre 2026. First version in this collection.

Keen 1.0.0 · 19 lignes
// http.get with an account: user= and password= send it in Basic. Here the account is optional: an empty
// user sends none, so the same line serves a page with or without an account.
need('protocol:http');
$user = need('protocol:http:user', 'optional');
$password = need('protocol:http:password', 'optional');

$url = variable('example:page:url', 'text', array(
    'label' => 'Address of the page',
    'help'  => 'For example https://intranet.example/.',
));

output('status', 'number', array('label' => 'Answer code'));

watch.expect('refused', 'Page refused', 'status', array('critical' => array(200)));

// The password is a secret: it goes only into the call, never into a value or a message, and never
// over http://.
$answer = http.get($url, user=$user, password=$password);
value('status', $answer['status']);