Create a gist now

Instantly share code, notes, and snippets.

@laser /client.php
Last active Aug 29, 2015

What would you like to do?
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