I have a REST web service written in PHP and I'm calling it using a POST request (making use of curl for this). The web service should return a JSON document. Problem is, I'm not sure what is the correct way to send this document back to the web service client. Is it sufficient to just echo it out?
Right now it looks like this is the only way in which i can get the JSON document to appear in the result of the POST request (the $result variable):
$result = curl_exec($ch);