问题标签 [zend-rest]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
php - 如何从 Zend_Rest_Client 调用 Lithium Forum API
我正在尝试使用 Zend_Rest_Client 访问 Lithium Forum Rest API。此处描述了 API:
http://cl.ly/3N0M2D0k0H3L0Y103Q3R
API 文档给出了示例调用,例如 /boards/id/experimentations/messages/id/938
如何使用 Zend Rest Client 复制此调用并指定每个单独的方法/参数?
我可以通过将整个 URL 放入我的新 Zend_rest_Client($url) 调用中来获得响应,但我希望拥有的不仅仅是控制权,以便我可以传递动态板和类别 ID。
我尝试过类似的东西
并且
但是参数被忽略了。任何人都可以对此有所了解吗?
如果有人想尝试一下,这里有一个实时 API:
http://lithosphere.lithium.com/lithium/restapi/vc/boards/nested
php - Zend_Rest_Controller 单元测试示例
我找到了一堆如何对 Zend_Controller 进行单元测试的示例,但我正在寻找有关 Zend_Rest_Controller 单元测试的示例。非常感谢任何帮助。谢谢!
zend-rest - 将 zend_rest 的输出转换为 json
我正在使用 Zend_Rest 在 joomla 中开发一个 REST api。由于 Zend 组件可以解耦,我没有在我的 joomla 安装中使用整个 Zend 框架,而是在创建我的应用程序时使用 Zend_Loader 和 Zend_Rest。
主要问题是 - 由于要求,我需要让服务器以 json 格式吐出的输出数据,而不是该组件吐出的 xml 树。
如果我使用整个框架,从我收集的内容中,contextSwitch 助手将为我完成简单的移植。
那么我如何将这些输出移植到 Json 中,我完全知道我没有适当的控制器动作并且我没有在 ZF 内开发。
我将不胜感激有关此的任何帮助。谢谢
php - Zend Rest Route 与层次结构
目前我有一个为事件控制器(/事件)工作的 REST 路由。我想在 EventSignUp 控制器中处理事件注册,并将此控制器映射到 /event/signups 路由。
Zend 框架文档声明 URL /event/signup/:id 应该映射到 Event_SignupController 。但这对我不起作用。
我为我的 Bootstrap 类中的所有控制器设置了默认的 REST 路由:
我是遗漏了什么还是文档有误?如果文档有误,我应该采取什么方法来实现我想要的目标?
附带说明一下,许多现有的控制器都依赖于默认的 REST 路由,因此如果有一个不需要为所有现有控制器实现新路由的解决方案,那就太好了。
编辑:文档说明 /product/ratings 将被转换为 Product_RatingsController,这意味着 Products 模块中的 RatingsController。因为我所有的控制器都放在默认模块中,所以 Rest Route 不支持我想要的行为。
所以这改变了我的问题,是否可以在不影响现有控制器对默认 Rest 路由的依赖的情况下实现我想要的行为?如果是这样,怎么做?如果没有,对我来说最好的方法是什么?
php - 使用 Zend_Rest_Server 的子类
Zend_Rest_Server 和 Zend_Rest_Client 的文档可悲地不足,所以我不断遇到这些令人麻木的烦人问题。
因此,为了简化我的 API 方法,我将调用 Zend_Rest_Server(),然后将服务器类设置为“X”,这反过来将扩展我的“api_server”类。在我的 api_server 类中,我会放置身份验证、哈希密钥处理等所有内容。
但是一旦我使用“class mdb extends api_server {”而不是“class mdb {”,我的整个 api 应用程序就会死掉。没有错误。日志中没有任何内容。没有输出。这是代码:
一旦我删除了整个“扩展 api_server”,它就会工作(虽然我没有任何服务器的身份验证方法,所以它失败了,但服务器正在运行并响应..
那么这是 Zend_Rest_Server() 的某种未记录的限制,还是我在做一些非常愚蠢的事情?
它似乎与自动加载无关,即使我需要保存 api_server 类的文件,它也不起作用。
zend-framework - 如何将 Zend_Rest_Server 响应头“zend”更改为“my_api”?
我使用 Zend Rest Server 类来处理休息服务:
Zend_Rest_Server 中的响应头
如何将生成器更改为不同的字符串?
谢谢阿曼。
php - Zend Framework route for Sub Folders with Rest
For my current Application Setup i am trying to create a routing for Standard Controllers and Rest Controllers.
This is my Structure.
To call a Controller within the admin Sub Folder:
I want to change this to:
In my current setup:
The issue here really is that some Controllers in the API folder are Rest but not all of them.
/api/acl/role is routing correctly to the indexAction as expected.
/api/acl/role/1 is looking for the action "1" where i would expect it to route to getAction.
How could i integrate the Zend_Route_Rest from the module Bootstrap into these rulesets.
Every help would be much appreciated.
zend-framework - 如何确保 Zend_Rest_Controller 中的多个参数验证?
我需要确保在我的 Zend_Rest_Controller 中提供了几个参数。
这是我的代码:
但是,如果我提供这样格式的 url(没有查询字符串):
它返回“正确”,而不是“缺少/无效参数”。
验证器中包含任何简单的解决方案或参数吗?
谢谢。
android - Android HttpGet 正在请求 indexAction
我的 HttpGet 请求正在调用我的 indexAction,而不是 getAction。这是怎么回事?
这是我的代码:
这是我在 Android 中的代码:
我的 HttpPost 工作正常(它调用 postAction),有什么解释吗?
谢谢。
php - Zend_Rest_Controller upload file
I have no strong php or Zend background, please bear with me if I asked silly questions.
I am trying to upload an image to Amazon Web Service S3, via Zend Framework's REST controller.
Most examples i found are about Zend Form, which is not suitable in my case, as I use REST POST.
I believe the file had to be converted into stream of bytes, and send to the Zend_Rest_Controller, but I have no idea how to do.
Any solution?