2012-06-08 4 views
0

젠드 프레임 워크를 사용하여 REST API를 사용할 수 있는지 알아야합니까?Zend_Rest_Client는 전통적인 객체 API 작업을 지원합니까? 오브젝트를 가져오고, 오브젝트와 오브젝트를 POST하십시오.

Zend_Rest_Client는 기존 객체 API 작업을 지원합니까?

PUT 개체, GET과 목적, POST 객체

대부분의 REST API의 내가 주로 객체 관리가 아니라 서비스 나 방법을 지향하고있다 보았다.

도움을 받으실 수 있습니다.

감사합니다.

답변

0

다음은 참조 설명서에서 발췌 한 내용으로 귀하의 질문에 대한 답변입니다. (짧은 대답은 '예'입니다.)

24.5.7.6. Zend_Rest_Route Zend_Rest 컴포넌트는 Zend_Controller_Router_Rewrite를위한 RESTful 라우트를 포함합니다. 이 경로는 HTTP 표준과 HTTP를 모듈, 컨트롤러 및 작업으로 변환하여 요청을 라우팅하는 표준화 된 라우팅 체계를 제공합니다 아래 테이블 은 요청 방법과 URI가 인 방식에 대한 개요를 제공합니다.

표 24.1.

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. 
에서 Zend_Rest_Route 동작