gpt4 book ai didi

php - Phil Sturgeon 的 REST API 总是返回 : status:0, 错误:未知方法

转载 作者:可可西里 更新时间:2023-11-01 00:45:44 26 4
gpt4 key购买 nike

我总是遇到这个错误。

        {"status":false,"error":"Unknown method."}

但从我这边来看,所有语法都是正确的。因为在浏览器上一切正常,但在设备上集成相同的 URL 会出现“未知方法错误”。

我正在使用这种“获取”方法。示例网址

       SITEURL/api/login/test?req_type=custom

我在集成时是否遗漏了什么?也许是一个设置?我刚刚包含了库和 rest 配置文件。

最佳答案

我认为你的问题是 Controller 的名称与方法的名称相同尝试进行测试:

如果您的 Controller 名称是:

class Test extends REST_Controller{
//your method name is different from the name of controller class
public function testget_get(){
echo $this->response(array('test'=> 'test'), 200);
}
}

我在 hmvc 结构上遇到过这个问题。

关于php - Phil Sturgeon 的 REST API 总是返回 : status:0, 错误:未知方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19517714/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com