首页 > 解决方案 > GuzzleHTTP 响应 400 状态

问题描述

我一直在使用 GuzzleHttp,这是我的代码片段,这似乎以某种方式管理 GuzzleHTTP 中的会话。

    $this->httpMethod=='GET';
    if(!empty($this->httpMethod) && $this->httpMethod=='POST'){
        $response = $this->client->post($finalUrl);
    }else{
        $response = $this->client->request($this->httpMethod, $finalUrl);
    }

不幸的是,我收到了这个致命错误-

Fatal error: Uncaught GuzzleHttp\Exception\ClientException: Client error: `GET https://creator.zoho.com/api/json/test/view/All_SMS?zc_ownername=zc_owner&raw=1&authtoken=auth_token&scope=crmapi` resulted in a `400 Bad Request` response:
{"code":2945,"message":"DATATYPE_NOT_MATCHED"}

标签: phpzohoguzzle

解决方案


查看Zoho API 错误代码

代码 2945 是无效票。

在没有深入研究 API 文档的情况下,我怀疑这是一个身份验证问题


推荐阅读