2012-06-08 47 views

回答

0

以下是参考手册的摘录,我希望能回答您的问题。 (简短答案是肯定的。)

24.5.7.6。 Zend_Rest_Route Zend_Rest组件包含一个Zend_Controller_Router_Rewrite的RESTful路由。此路由提供 标准化路由方案,通过将HTTP方法和URI转换为模块,控制器和操作来路由请求。下面的表 概述了请求方法和URI如何路由 。

表24.1。 Zend_Rest_Route行为

Method URI Module_Controller::action 
GET /product/ratings/ Product_RatingsController::indexAction() 
GET /product/ratings/:id Product_RatingsController::getAction() 
POST /product/ratings Product_RatingsController::postAction() 
PUT /product/ratings/:id Product_RatingsController::putAction() 
DELETE /product/ratings/:id Product_RatingsController::deleteAction() 
POST /product/ratings/:id?_method=PUT Product_RatingsController::putAction() 
POST /product/ratings/:id?_method=DELETE Product_RatingsController::deleteAction() 

,并从Zend_Rest_Client API

restDelete(string $path, $data = null) : \Zend_Http_Response 
Performs an HTTP DELETE request to $path. 


restGet(string $path, array $query = null) : \Zend_Http_Response 
Performs an HTTP GET request to the $path. 


restPost(string $path, mixed $data = null) : \Zend_Http_Response 
Performs an HTTP POST request to $path. 


restPut(string $path, mixed $data = null) : \Zend_Http_Response 
Performs an HTTP PUT request to $path.