Skip to content

AVADOLearning/moodle-webservice_loadedrest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Loaded REST

A Moodle webservice protocol implementation that allows requests with bodies. It's not true REST as it's not resourceful.


Installation

  1. Place this repository in /webservice/loadedrest.
  2. Execute the Moodle upgrades via the CLI or web UI.

Configuration

  1. Ensure Enable web services is enabled under Site administration > Advanced features.
  2. Navigate to Site administration > Plugins > Web services > Manage protocols and enable Loaded REST protocol.
  3. Assign the Use Loaded REST protocol capability to the desired roles under Site administration > Users > Permissions > Define roles.

Sample client usage

use webservice_loadedrest\client;

$serverurl = '/webservice/loadedrest/server.php';
$token = '000000000000000000000000000000000000';
$httpmethod = 'PUT';
$wsfunction = 'component_function';
$params = [
    'myargs' => [
        [
            'param' => 'look, nesting!',
        ],
    ],
];

$client = new client($serverurl, $token);
try {
    var_dump($client->call($httpmethod, $wsfunction, $params));
} catch (Exception $e) {
    var_dump($e);
}

About

It's not REST, but it's closer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages