From 1b3ff0de4ac1d98139fdb5d275d1d06bf81a176d Mon Sep 17 00:00:00 2001 From: Maurits van der Schee Date: Fri, 17 Mar 2017 09:48:17 +0100 Subject: [PATCH] Update client.php --- examples/client.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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)); ?>