<?php
$client = new Yar_Client("http://api.example.com/operator.php");
/* Set timeout to 1s */
$client->setOpt(YAR_OPT_TIMEOUT, 1000);
/* Set packager to JSON */
$client->setOpt(YAR_OPT_PACKAGER, "json");
/* Set custom headers */
$client->setOpt(YAR_OPT_HEADER, ["X-Api-Key: value"]);
/* Route through an HTTP proxy */
$client->setOpt(YAR_OPT_PROXY, "127.0.0.1:8888");
/* call remote service */
$result = $client->some_method("parameter");
?>