我能夠獲得JSON輸出,如果我在瀏覽器中鍵入http://localhost/CodeIg/index.php/quiz/user,但是如果我輸入http://localhost/CodeIg/index.php/quiz/restclient它給這個錯誤:{"status":false,"error":"Unknown method"}
{「地位」:假的,「錯誤」:「未知法」}錯誤笨的RESTful API
我試過將get
更改爲post
,但仍然出現同樣的錯誤。
我把這個頁面https://code.tutsplus.com/tutorials/working-with-restful-services-in-codeigniter--net-8814這樣做了。