Zend Framework REST service HTTP status code problem
- by Baversjo
I'm trying to create a REST service in zend framework. I'm using zend server.
Here's my code:
class ArticleController extends Zend_Rest_Controller
{
public function postAction()
{
//Create the acticle and return it
$data = array("foo" => 0, "boo" => 11);
$this->getResponse()->setHttpResponseCode(201);
$this->_helper->json($data);
}
The HTTP response returns the appropriate headers and JSON data but under the JSON data there's an apache error document.
The only way I can think of to remove the appended error document is to add the following in my httpd.conf file:
ErrorDocument 201 " "
But what's the "corrent" way of doing this?