Skip to content

Instantly share code, notes, and snippets.

@laser
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laser/b617ae436c88f2b66014 to your computer and use it in GitHub Desktop.
Save laser/b617ae436c88f2b66014 to your computer and use it in GitHub Desktop.
Basic Client - PHP
#!/usr/bin/env php
<?php
include_once("./lib/barrister.php");
$barrister = new Barrister();
$client = $barrister->httpClient("http://localhost:3000/v1/todos");
$proxy = $client->proxy("TodoManager");
try {
$result = $proxy->createTodo([ "title" => "Call Mom", "completed" => false ]);
var_dump($result);
}
catch (BarristerRpcException $e) {
echo "err.code=" . $e->getCode() . "\n";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment