Am I missing something - GET vs POST

Am I missing something - GET vs POST

door Martin Greenaway -
Aantal antwoorden: 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

Gemiddelde van de beoordelingen:  -
Als antwoord op Martin Greenaway

Re: Am I missing something - GET vs POST

door Andreas Grabs -
Foto van Core developers Foto van Particularly helpful Moodlers Foto van Peer reviewers Foto van Plugin developers Foto van Translators
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
Gemiddelde van de beoordelingen: Useful (1)
Als antwoord op Andreas Grabs

Re: Am I missing something - GET vs POST

door 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
Gemiddelde van de beoordelingen:  -