卷曲信息 - curl_getinfo中是否有任何错误?

时间:2016-11-06 20:27:56

标签: php curl

我得到空白的卷曲反应。请检查我的卷曲信息

print_r(curl_getinfo($curl));
Array
    (
        [url] => http://aabb.com/api.php
        [content_type] => text/html; charset=iso-8359-1
        [http_code] => 200
        [header_size] => 439
        [request_size] => 361
        [filetime] => -1
        [ssl_verify_result] => 0
        [redirect_count] => 0
        [total_time] => 1.943
        [namelookup_time] => 0
        [connect_time] => 0.734
        [pretransfer_time] => 0.734
        [size_upload] => 5049
        [size_download] => 0
        [speed_download] => 0
        [speed_upload] => 2585
        [download_content_length] => 0
        [upload_content_length] => 5049
        [starttransfer_time] => 1.094
        [redirect_time] => 0
        [redirect_url] => 
        [primary_ip] => 31.131.83.86 //gives correct IP
        [certinfo] => Array
            (
            )

        [primary_port] => 80
        [local_ip] => 132.138.43.36
        [local_port] => 44146
    )

请帮忙。我现在真的很厌倦了。你认为在这个信息中一切似乎都没问题 我的代码在

之下
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://aabb.com/api.php');
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 20);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

$response = curl_exec($curl);

if (curl_error($curl)) { 
    print curl_error($curl); 
} else{
    print_r($response);
}
curl_getinfo($curl);
curl_close($curl);
exit;

0 个答案:

没有答案