Am I missing something - GET vs POST

Am I missing something - GET vs POST

Martin Greenaway
Vastuste arv 2

When setting up a new custom web service, I understand the process as described in the documentation on here and I can get it working fine, and have done several times for various integrations.

My question is why I can't then authenticate to get my token using POST instead of GET, so that I don't have to spread the credentials around in ISP logs at every hop. I've tried it but I can't seem to get it to work, even though I thought that part of the point of require_param() (which is what the token authentication is using) was that it was meant to abstract whether a parameter was provided in the query string, in the headers, via GET or POST.

Am I missing something?

For reference, this is on Moodle 3.11.7 and 3.9.14

Keskmine hinnang: -
Vastuses Martin Greenaway

Re: Am I missing something - GET vs POST

Andreas Grabs
Core developers pilt Particularly helpful Moodlers pilt Peer reviewers pilt Plugin developers pilt Translators pilt
Hi Martin,

there is a nice plugin that gives you a restful api.
https://moodle.org/plugins/webservice_restful
Maybe it is what you are looking for.

Best regards
Andreas
Vastuses Andreas Grabs

Re: Am I missing something - GET vs POST

Martin Greenaway
Thank you very much, Andreas - this has solved my problem. To be honest, I think this should be the way that it works by default, but that's just me :D