I am trying to hit an API from one server to another and getting this response in curl_error($curl);
HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1). Frequency of getting this error message is low, out of 10 attempts 1 to 2 times.
But why i am getting this error, is any specific reason that i am missing?
my Curl code is:
$data = http_build_query(array('param1' => 'test','status' => 'Success'));
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, "server api link");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($curl);
if (curl_error($curl)) {
$error_msg = curl_error($curl);
}
print_r($error_msg);
curl_close($curl);
Query is same as asked at this link curl php HTTP/2 stream 0 was not closed cleanly
Asking it again as no solution found in previous link, even not at any other locations.