我想对 Moodle Webservices 使用 json 格式 我已经配置了 REST 协议(protocol) 站点管理/► 插件/► Web 服务/► 管理协议(protocol)
但是当我尝试从浏览器进行此调用时 http://localhost/moodle/webservice/rest/server.php?wsfunction=core_enrol_get_users_courses&wstoken=a6e17971d60ddcd8f7ea648a605cebb8&userid=4
答案是 XML 格式,而不是 JSON 格式。 我需要做什么来设置 JSON 格式?
谢谢
最佳答案
我自己在http请求末尾使用moodlewsrestformat=json解决了
关于json - Moodle:如何将Web服务消息从xml更改为json,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32952322/