php - 工作示例 Zend_Rest_Controller 与 Zend_Rest_Client?

标签 php zend-framework rest

我正在尝试使用 Zend Framework 编写一个简短的 Rest Service。但是这部分的文档并不是最好的。

我有一个 ApiController 扩展的 Zend_Rest_Controller,带有所有需要的抽象方法。我的目标是获取 Post 数据并返回一些东西。

我的客户是这样的:

    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();
    }

但是提供的“$client->url”不在服务器端的 post 数组中。我是否必须在 ApiController 的 postAction 中使用 Zend Rest Server?

如果有人有如何使用 Zend Rest 发送和获取数据的示例,那就太好了。

最佳答案

也许这个教程Create RESTful Applications Using The Zend Framework可以提供帮助。

关于php - 工作示例 Zend_Rest_Controller 与 Zend_Rest_Client?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1774928/

相关文章:

php - 如何从 PHP 数组中检索值?

arrays - Zend_Form 没有索引的数组符号

rest - 套接字可以代替 HTTP 请求吗? (套接字与 http)

php - 用 PHP 编写数据访问代码

php - 我如何从 array() 中删除它?

php - Zend_Framework- 在哪里放置 $_GET 和 $_POST(HTTP 请求)处理?

php - Zend 框架 - 如何验证电子邮件?

java - 查询参数长度限制

java - 如何获取 java 的 restful GET/POST 方法列表?

php - 处理 wordpress 数据库中的重复键