...
Code Block |
---|
language | php |
---|
title | View page response |
---|
linenumbers | true |
---|
collapse | true |
---|
|
stdClass Object
(
[uri] => http://74your-domain.localhostcom/user/200
[id] => 200
[resource] => user
[uuid] => 2fd044c5-ff4a-4bfe-8472-9b9b56eb0fc6
)
|
Update (PUT)
TBD
Example Request
Code Block |
---|
language | php |
---|
linenumbers | true |
---|
collapse | true |
---|
|
|
Delete (DELETE)
Delete requests do not return any data, other than the HTTP headers, which can be used to verify success. A status code of 200, indicates a successful deletion call.
Example Request
Code Block |
---|
language | php |
---|
title | Deleting awarded credit |
---|
linenumbers | true |
---|
collapse | true |
---|
|
$curl = curl_init("http://74your-domain.localhostcom/course_credit_awarded/214"); // Note the 214, which is the entity id of the course_credit_awarded record associated to the user & course
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($curl, CURLOPT_HTTPHEADER, array("X-CSRF-Token: $token", "Content-Type: application/json"));
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, "restws_webservice:webservice_password"); //Your credentials goes here
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
print 'Deleting...';
$json = curl_exec($curl);
$cinfo = curl_getinfo($curl);
$response = json_decode($json);
if($cinfo['http_code'] == 200 && empty($response)){
print 'The entity has been deleted'.
}
|