Am I missing something - GET vs POST

Am I missing something - GET vs POST

av Martin Greenaway -
Antall svar: 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

Gjennomsnittlig vurdering: -
Som svar til Martin Greenaway

Re: Am I missing something - GET vs POST

av Andreas Grabs -
Bilde av Core developers Bilde av Particularly helpful Moodlers Bilde av Peer reviewers Bilde av Plugin developers Bilde av 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
Gjennomsnittlig vurdering:Useful (1)
Som svar til Andreas Grabs

Re: Am I missing something - GET vs POST

av 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