我想用Zend Framework編寫一個簡短的Rest服務。但是這部分文檔並不是最好的。帶Zend_Rest_Client的工作示例Zend_Rest_Controller?
我有一個ApiController擴展Zend_Rest_Controller與所有需要的抽象方法。我的目標是獲取發佈數據並返回一些內容。
我的客戶是這樣的:
public function indexAction()
{
$url = 'http://localhost/url/public/api';
$client = new Zend_Rest_Client();
$client->setUri($url);
$client->url = 'http://www.google.de';
$result = $client->post();
}
,但所提供的「客戶端 - $> URL」是不是接線柱陣列服務器端裏面。我必須在我的ApiController的postAction中使用Zend Rest Server嗎?
如果有人舉例說明如何通過Zend Rest發送和獲取數據,那就太好了。