Working example of Zend_Rest_Controller with Zend_Rest_Client?

I am trying to write a short Rest service with the Zend Framework. But the documentation is not the best in this part.

I have an advanced Zend_Rest_Controller with ApiController with all the necessary abstract methods. My goal is to get the 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 server-side post array. Should I use Zend Rest Server inside postAction on my ApiController?

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

+6
rest php zend-framework
source share
2 answers
+7
source share

Did you try to configure it to access 127.0.0.1 rather than localhost? I know that sometimes it can cause problems.

0
source share

All Articles