我正在實現一個客戶端來使用vtiger REST API,並在登錄過程中設法讓它使用curl而不是使用Guzzle。Guzzle vs CURL與vtiger網絡服務交互,CURL工程,但Guzzle不
狂飲代碼:
$postData = [
'operation' => 'login',
'username' => $userName,
'accessKey' => $generatedKey
];
$response = $client->post($url, [
'form_params' => $postData
]);
沒有實際狂飲錯誤或異常,但就是這樣,我不能夠驗證:
{"success":false,"error":{"code":"INVALID_AUTH_TOKEN","message":"Specified token is invalid or expired"}}
捲曲版本:
$curl = curl_init($service_url);
$curl_post_data = array(
'operation' => 'login',
'username' => $crm_username,
'accessKey' => md5($crm_token.$crm_useraccesskey),
);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
我更喜歡使用Guzzle,但現在我不知道爲什麼它不能在Guzzle中工作,但它確實使用捲曲。有任何想法嗎?
請提供有關導致錯誤的詳細信息工作正常,我。 Guzzle版本從服務器上得到什麼錯誤? –
@AlexeyShockov沒有實際的Guzzle錯誤,但我沒有得到預期的響應,儘管發送了正確的數據 – DanielRestrepo