0

I am getting blank curl response. Please check my curl info

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
    )

Please help . I am really fed up now. Do you think everything seems okay in this info My code is below

$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;
Barmar
  • 741,623
  • 53
  • 500
  • 612
Amar Singh
  • 5,464
  • 2
  • 26
  • 55

0 Answers0