I have written an API for updating the User information using the PUT method & here is the cURL code :
$postData = http_build_query($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $curlUrl);
//curl_setopt($ch, CURLOPT_PUT, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json'));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS,$postData);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
return $response;
Here $data is the Associative array (key=>value pair). After the request is done in the API end. I'm getting the response as :
11{"Status":200,"Response":"Success","ResponseData":"User Information updated successfully"}
Here, in the response. I'm not able to figure out why that integer value 11 is coming. Please do provide the reason & how to fix it.
thanks in advance, Srinivasu....