case 1
When run php file (http://localhost:8080/Rub_test.php) with below curl implemented code at postman then this error appear cURL Error #:Operation timed out after 50007 milliseconds with 30461 out of 272389 bytes received
When increased CURLOPT_TIMEOUT => 500000 then error not appear but print_r($response); blank show.
case 2
When run only URL with authorization at postman then data show.
please suggest how to get data with curl-php. Or any mistake in curl. please help me.
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.rubiproject.com/analytics/v1/report/?account=publisher%2F11990&start=2022-09-01T00%3A00%3A00-08%3A00&end=2022-09-02T23%3A59%3A59-08%3A00&dimensions=date%2Ccountry%2Csite&metrics=ad_requests%2Cauctions_won%2Cpaid_impression%2Crevenue",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 50,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"authorization: Basic YjA2MzljMzJmYWM0OTA2ssssssssZWNmMjJiZjY0YjljZZWU4NzlkBMGVhMzkxODo0sswwNjk1OTc5YjRlYTaI1NWIyM2Y5NWFlZDE1M2YzODI0Yw==",
"cache-control: no-cache",
"content-type: application/json"
),
CURLOPT_FILE => $fp,
CURLOPT_FOLLOWLOCATION => true
));
$response = curl_exec($curl);
print_r($response);
$err = curl_error($curl);