我目前正在使用(Guzzle客户程序/ Laravel)开发自定义API的其余API。我通过添加错误的身体尝试了几次。我收到以下错误
cURL错误0:cURL请求已重试3次,但未成功。失败的最可能原因是cURL无法倒回请求的正文,并且随后的重试导致了相同的错误。打开调试选项,看看出了什么问题。有关更多信息,请参见https://bugs.php.net/bug.php?id=47204。 (请参见http://curl.haxx.se/libcurl/c/libcurl-errors.html)
以下是我的开发环境的详细信息:
Language : php,
Framework : Laravel 5.4,
Client : Guzzle,
OS : Ubuntu 16.04
我想知道这背后的原因
请在这件事上帮助我,
谢谢
以下是我的代码
{
$headers = [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer '.$this->accessTocken,
'Accept' => 'application/json',
];
$Body = [
'method' => 'AndroidApp',
'msisdn' => '94777400725',
];
$client = new Client();
$response = $client->post( $this->url, ['headers'=> $headers,
'json'=> $Body]);
}
$ response-> getBody()-> rewind();
为我工作]