I'm using cURL to make some API calls, and everything worked fine until today. The only thing that changed is that I've added some content to the db that the API returns. The interesting thing is that I get a http_status of 200, but an empty response. What's even stranger is that some other calls do work, so my guess is that it's somehow related to the size of the response.
When running that same request from some webservice like Postman, I can see that the API in fact does return data, it's only on the server that the cURL returns empty array.
I make a cURL request like this:
$curl = curl_init(API_URL);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER,
array("Content-type: application/json"));
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
curl_setopt($curl,CURLOPT_TIMEOUT,10);
The curl_getinfo
for the empty response returns something like this:
Array
(
[url] => api_url_to_which_im_sending
[content_type] => application/json;charset=utf-8
[http_code] => 200
[header_size] => 157
[request_size] => 219
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.656782
[namelookup_time] => 3.9E-5
[connect_time] => 0.121461
[pretransfer_time] => 0.121504
[size_upload] => 83
[size_download] => 17355
[speed_download] => 26424
[speed_upload] => 126
[download_content_length] => -1
[upload_content_length] => 83
[starttransfer_time] => 0.292595
[redirect_time] => 0
[certinfo] => Array
(
)
[primary_ip] => someip
[primary_port] => 80
[local_ip] => someotherip
[local_port] => someport
[redirect_url] =>
)
The only notable difference to the API calls that actually return some data are the:
[size_download] => 17355
[speed_download] => 26424
lines, which are a lot smaller (300 - 800).
So my question is, since I'm guessing that it's somehow size related, what server setting is responsible for this, and how can I increase allowed response size?