我有一个类似的卷曲帖子
curl_setopt($ch, CURLOPT_URL,$cpUrl);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $varpost); // post parameters
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // Return the output in string format
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_NOBODY, true);
$output = curl_exec ($ch); // Execute
curl_close($ch)之后如何检查;发送了哪些字段后变量?请帮助
curl_close($ch)之后如何检查;字段后变量是什么发送?
您的脚本提供了使用CURLOPT_POSTFIELDS
选项发送的变量,因此,如果cURL成功执行,您就已经有了这些变量:
...
$output = curl_exec($ch); // Execute
//show the POST fields if they were sent successfully
if($output) print_r($varpost);
else echo "cURL failed: no POST fields sent";
您可以使用Fiddler检查客户端和服务器之间实际传输的数据