Moodle APIs 4.3
Moodle 4.3.6 (Build: 20240812)
webservice_rest_client Class Reference

Moodle REST library. More...

Public Member Functions

 __construct ($serverurl, $token, $format='xml')
 Constructor.
 
 call ($functionname, $params)
 Execute client WS request with token authentication.
 
 set_token ($token)
 Set the token used to do the REST call.
 

Detailed Description

Moodle REST library.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later Moodle REST client

It has been implemented for unit testing purpose (all protocols have similar client)

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

webservice_rest_client::__construct ( $serverurl,
$token,
$format = 'xml' )

Constructor.

Parameters
string$serverurla Moodle URL
string$tokenthe token used to do the web service call
string$formatreturned value format: xml or json

Member Function Documentation

◆ call()

webservice_rest_client::call ( $functionname,
$params )

Execute client WS request with token authentication.

Parameters
string$functionnamethe function name
array$paramsthe parameters of the function
Return values
mixed

◆ set_token()

webservice_rest_client::set_token ( $token)

Set the token used to do the REST call.

Parameters
string$tokenthe token used to do the web service call

The documentation for this class was generated from the following file: