duanjing7459
2018-05-29 19:23
浏览 1.3k
已采纳

GuzzleHTTP响应400状态

I have been using GuzzleHttp and here is my code snippet and this appears to manage Session in GuzzleHTTP somehow.

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

Unfortunately, I am getting this Fatal Error-

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"}

图片转代码服务由CSDN问答提供 功能建议

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

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

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

 致命 错误:未捕获GuzzleHttp \ Exception \ ClientException:客户端错误:`GET https://creator.zoho.com/api/json/test/view/All_SMS?zc_ownername = zc_owner& raw = 1& authtoken = auth_token& scope = crmapi` 导致“400 Bad Request”响应:
 {“code”:2945,“message”:“DATATYPE_NOT_MATCHED”} 
   
 
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongzantai7570 2018-05-29 19:50
    已采纳

    Review the Zoho API error codes.

    Code 2945 is an invalid ticket.

    Without studying the API documentation in depth, I suspect it is an authentication problem.

    评论
    解决 无用
    打赏 举报

相关推荐 更多相似问题