Skip to content

Commit 1b3ff0d

Browse files
authored
Update client.php
1 parent c5627c4 commit 1b3ff0d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

examples/client.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ function call($method, $url, $data = false) {
1616
return curl_exec($ch);
1717
}
1818

19-
$response = call('GET', 'http://localhost/api.php/posts');
19+
$response = call('GET', 'http://localhost/api.php/posts?include=categories');
2020
$jsonObject = json_decode($response, true);
2121

2222
$jsonObject = php_crud_api_transform($jsonObject);
2323
$output = json_encode($jsonObject, JSON_PRETTY_PRINT);
2424

25-
$post = array('user_id'=>1,'category_id'=>1,'content'=>'from php');
26-
call('POST', 'http://localhost/api.php/posts',json_encode($post));
25+
$object = array('user_id'=>1,'category_id'=>1,'content'=>'from php');
26+
call('POST', 'http://localhost/api.php/posts',json_encode($object));
2727

2828
?>
2929
<html>

0 commit comments

Comments
 (0)