Moodle API - accepted input format

Moodle API - accepted input format

дэргэд Maxime Paintendre -
Хариу нийтлэлийн тоо: 2

Hi all,

I am currently working on the implementation of the Moodle API. 

For testing purposes and for further development, I would like to know what formats are supported by the API in input.

I have seen from the tests that we can request in get via query params, but when we want to send data, what format can we use?

Via postman, I managed to post data via `form-data` and `x-www-form-urlencoded` but can we also send JSON directly? 

I tested but for the moment without success.

thanks in advance.


Үнэлгээний дундаж: -
Maxime Paintendre-н хариуд

Re: Moodle API - accepted input format

дэргэд Francis Devine -
Core developers зураг
Hi Maxime, the default supported data for the rest endpoint is as far as I know, only form-data, x-www-form-urlencoded.

There is also a SOAP endpoint and XML-RPC (both the ZEND implementations)

Personally I'd recommend https://github.com/catalyst/moodle-webservice_restful

I'm biased though, since this was written by my colleagues in our australian office.

This brings the webservices experience much closer to what more traditional REST endpoints look like and is easier to approach (at least in my opinion)