add example for #211
This commit is contained in:
parent
a522bccb98
commit
c5627c4260
1 changed files with 5 additions and 1 deletions
|
|
@ -16,11 +16,15 @@ function call($method, $url, $data = false) {
|
|||
return curl_exec($ch);
|
||||
}
|
||||
|
||||
$response = call('GET', 'http://localhost/api.php/posts?include=categories,tags,comments&filter=id,eq,1');
|
||||
$response = call('GET', 'http://localhost/api.php/posts');
|
||||
$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));
|
||||
|
||||
?>
|
||||
<html>
|
||||
<head>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue