Skip to content

Commit c5627c4

Browse files
committed
add example for #211
1 parent a522bcc commit c5627c4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

examples/client.php

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

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

2222
$jsonObject = php_crud_api_transform($jsonObject);
2323
$output = json_encode($jsonObject, JSON_PRETTY_PRINT);
24+
25+
$post = array('user_id'=>1,'category_id'=>1,'content'=>'from php');
26+
call('POST', 'http://localhost/api.php/posts',json_encode($post));
27+
2428
?>
2529
<html>
2630
<head>

0 commit comments

Comments
 (0)