ZF: Zend_Rest_Client::restDelete() ‘Unexpected error: No Method Specified’

When using Zend_Rest_Client & Zend_Rest_Server with ZF v1.10.2, to quickly build a Rest webservice, performing simple restDelete() queries ended up with following error message:

Unexpected error: No Method Specified

In fact, current implementation of Zend_Rest_Client::restDelete() does not provide any request parameter to queried url.
On server side, Zend_Rest_Server expects the ‘method’ argument to be provided => above error is generated.

To avoid this problem, I had to update Zend_Rest_Client with following updated method:

* Performs an HTTP DELETE request to $path.
* @param string $path
* @param array $query Array of GET parameters
* @throws Zend_Http_Client_Exception
* @return Zend_Http_Response
final public function restDelete($path, $query = null)
$client = self::getHttpClient();
return $client->request('DELETE');

note: subclassing the class was not an option since most of its methods are ‘final’! Grrrr…

For more information, look at corresponding tickets (see links below)


Post a Comment

Your email is never published nor shared. You're allow to say what you want...

Warning: fsockopen() [function.fsockopen]: php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/remydamo/websites/qc4blog/www/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81

Warning: fsockopen() [function.fsockopen]: unable to connect to www.sweetcaptcha.com:80 (php_network_getaddresses: getaddrinfo failed: Name or service not known) in /home/remydamo/websites/qc4blog/www/wp-content/plugins/sweetcaptcha-revolutionary-free-captcha-service/library/sweetcaptcha.php on line 81