0
我需要知道我们是否可以使用Zend Framework来为REST API提供动力?Zend_Rest_Client是否支持传统的对象API工作,例如PUT对象,GET和对象,POST对象
Zend_Rest_Client是否支持传统的对象API工作,例如
把一个对象,GET和对象,POST对象
大多数REST API的我见过大多是围绕目标管理,而不是服务或方法为主。
帮助将不胜感激。
谢谢。
我需要知道我们是否可以使用Zend Framework来为REST API提供动力?Zend_Rest_Client是否支持传统的对象API工作,例如PUT对象,GET和对象,POST对象
Zend_Rest_Client是否支持传统的对象API工作,例如
把一个对象,GET和对象,POST对象
大多数REST API的我见过大多是围绕目标管理,而不是服务或方法为主。
帮助将不胜感激。
谢谢。
以下是参考手册的摘录,我希望能回答您的问题。 (简短答案是肯定的。)
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()
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.