In PHP Curl code, we can send 16,000 characters only at once. If at all the data sent contains more than 16,000 characters, then the data is broken down and sent to server.
Here is how the data is broken down:
How the data is passed:
$parameters {
"Data1" => 1.
"Data2" => <string_containing_20000_characters>,
"Data3" => <string_containing_25000_characters>,
"Data4" => 4
}
How it is sent to the server:
_POST {
"Data1" => 1.
"Data2" => <first_16000_characters><first_4000_characters>,
"Data3" => <first_16000_characters><first_9000_characters>,
"Data4" => 4
}
My PHP Code :
$curl_post_data = array("Data1" => "1", "Data2" => "<string_containing_20000_characters>", "Data3" => "<string_containing_25000_characters>", "Data4" => "4");
$curl = curl_init($rest_webservice_url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $curl_post_data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$rest_return_data = curl_exec($curl);
curl_close($curl);
echo $rest_return_data;
In php.ini below changes has been done.
max_execution_time = 300
max_input_time = 600
memory_limit = 1280M
post_max_size = 2048M
upload_max_filesize = 2048M
max_file_uploads = 200
Could please anyone can help me out what is the wrong with my above code.