开发者

How to call the Lithium Forum API from Zend_Rest_Client

开发者 https://www.devze.com 2023-02-22 13:50 出处:网络
I\'m trying to access a Lithium Forum Rest API using Zend_Rest_Client. The API is described here: http://cl.ly/3N0M2D0k0H3L0Y103Q3R

I'm trying to access a Lithium Forum Rest API using Zend_Rest_Client. The API is described here:

http://cl.ly/3N0M2D0k0H3L0Y103Q3R

The API docs give example calls such as e.g. /boards/id/experimentations/messages/id/938

How can I replicate this call Using Zend Rest Client and specifying each individual method / parameter?

I can get a response by putting the entire URL in my new Zend_rest_Client($url) call but I want to have more than co开发者_如何学JAVAntrol so that I can pass dynamic board and category ids.

I have tried something like

$result = $client->arg('categories')->arg2('id')->arg3($cat->string_id)->arg4('boards')->arg5('nested')->get();

and also

$result = $client->categories($cat->string_id)...

But the parameters are ignored. Can anyone shed any light on this?

If anyone wanted to try it, there is a live API here:

http://lithosphere.lithium.com/lithium/restapi/vc/boards/nested


looks like this particular API is not compatible with Zend_Rest_Client as it doesn't seem to support methods and parameters in the URI as the client expects. The solution is to build dynamic URLS to call via GET or use POST parameters

0

精彩评论

暂无评论...
验证码 换一张
取 消