diff --git a/examples/client.php b/examples/client.php index 3d111da..234a6d2 100644 --- a/examples/client.php +++ b/examples/client.php @@ -16,14 +16,14 @@ function call($method, $url, $data = false) { return curl_exec($ch); } -$response = call('GET', 'http://localhost/api.php/posts'); +$response = call('GET', 'http://localhost/api.php/posts?include=categories'); $jsonObject = json_decode($response, true); $jsonObject = php_crud_api_transform($jsonObject); $output = json_encode($jsonObject, JSON_PRETTY_PRINT); -$post = array('user_id'=>1,'category_id'=>1,'content'=>'from php'); -call('POST', 'http://localhost/api.php/posts',json_encode($post)); +$object = array('user_id'=>1,'category_id'=>1,'content'=>'from php'); +call('POST', 'http://localhost/api.php/posts',json_encode($object)); ?>