Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Working example Zend_Rest_Controller with Zend_Rest_Client?

I am trying to write a short Rest Service with Zend Framework. But the documentation is not the best at this Part.

I have an ApiController extended Zend_Rest_Controller with all needed abstract methods. My goal is to get Post data and return something.

My client looks like this:

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

but the provided "$client->url" is not inside the post array on Server side. Does I have to use Zend Rest Server inside the postAction on my ApiController?

If someone has an example how to send and to get the data with Zend Rest, that would be great.

like image 870
opHASnoNAME Avatar asked Nov 21 '09 08:11

opHASnoNAME


1 Answers

Maybe this tutorial Create RESTful Applications Using The Zend Framework can help.

like image 152
Gordon Avatar answered Sep 20 '22 23:09

Gordon