Questions tagged [zend-rest]
46 questions
1
vote
1 answer
Zend $this->_helper->json returns array instead of JSON
We are developing an API with the ZEND Framework. Here is an example response
$this->getResponse()
->setHttpResponseCode(200)
->appendBody($this->_helper->json($client->toArray()));
I imagined $this->_helper->json would return a JSON string but…

JoshH2
- 55
- 6
1
vote
1 answer
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.
/application
/modules
/module
/controllers
/Admin
/Api
To call a Controller within the…

Martin Shwalbe
- 56
- 4
1
vote
2 answers
Examples on Zend_Rest_Controller Unit Testing
I have found a bunch of examples how to unit test Zend_Controller, but I'm looking for examples on Zend_Rest_Controller Unit Testing. Any help is really appreciated. Thank you!

eistrati
- 2,314
- 6
- 26
- 35
1
vote
1 answer
Correct code structure when providing REST API access using Zend_Rest_Controller
I'm new to Zend Frameworks and MVC type programming (not PHP though) and I'm trying to provide API access to data on my server using the Zend Framework.
I'm using Chris Danielson's article…

siliconpi
- 8,105
- 18
- 69
- 107
1
vote
1 answer
Unable to Connect error with Zend_Rest_Client on localhost
I am using Zend_Rest_Client to connect Zend_Rest_Server, everything seems to be alright, but when I try to get() from the server I recieve this error:
Zend_Http_Client_Adapter_Exception:
Unable to Connect to
tcp://localhost:80. Error #10060: A
…

Martin Rázus
- 4,615
- 5
- 30
- 33
1
vote
1 answer
Zend Rest Client issue
i have the codes below
class ReservationController extends Zend_Controller_Action
{
public function init()
{
}
public function indexAction()
{
$this->_helper->viewRenderer->setNoRender();
…

Nisanth Kumar
- 5,667
- 8
- 33
- 43
1
vote
1 answer
My form is not getting validated in Zend Famework. Why?
I am creating a rest Module for album module of zf2
My Code Snippet for create method :
public function create($data) {
$form=new AlbumForm();
$album = new Album();
$form->setInputFilter($album->getInputFilter());
$form->setData($data);
if…

Bhavik Joshi
- 2,557
- 6
- 24
- 48
1
vote
1 answer
zend framework1.12 rest services for web and mobile app
im new to zend framework and would like to create a web portal which offers a services .
The services would be used by webapplication and mobile application both.
I'm using Chris Danielson's article…

mark rammmy
- 1,478
- 5
- 27
- 61
1
vote
1 answer
Ajax reads success as error from zend rest controller
I'm using ajax to do a POST request to an API built on the Zend Framework. The API is returning a success JSON message, but AJAX is reading it as an error.
I've read through about a half dozen posts and implement their solutions. Nothing is…

liz
- 830
- 14
- 32
0
votes
1 answer
zend rest route messing up routing for default controller
I have implemented a RESTful service by extending the Zend_Rest_Controller. The service works great. I have only one controller that actually has RESTful behavior. So I added the rest route for just that controller in the bootstrap.
protected…

biker46s
- 43
- 5
0
votes
1 answer
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…

VHanded
- 2,079
- 4
- 30
- 55
0
votes
1 answer
Android HttpGet is requesting indexAction
my HttpGet request is calling my indexAction, instead of getAction. What's going on?
Here are my codes:
public function getAction() {
$id = $this->_getParam('id');
if(!$id)
{
$this->getResponse()
…

VHanded
- 2,079
- 4
- 30
- 55
0
votes
1 answer
How to ensure several parameters validation in a Zend_Rest_Controller?
I need to make sure that several parameters are provided in my Zend_Rest_Controller.
Here is my code:
public function indexAction() {
$filters = array(
'locid' => array('HtmlEntities', 'StringTrim')
);
…

VHanded
- 2,079
- 4
- 30
- 55
0
votes
1 answer
Zend_Rest_Server + Zend_Rest_Client, variable not read
What i am trying to do is pass $rest->apikey to my Zend_Rest_Server.
The empAction creates the array needed by my Zend_Rest_Server. But in getByShortname($id,$apikey), I cannot read the $apikey. They query to check the API key does not return any…

wenbert
- 5,263
- 8
- 48
- 77
0
votes
1 answer
How to change the Zend_Rest_Server response header 'zend' to "my_api"?
I use Zend Rest Server class to handle rest srvice:
public function restAction() {
$service = new Zend_Rest_Server();
$service->setClass($this->_serviceClassName);
$service->handle();
}
In the Zend_Rest_Server the…

Arman
- 4,566
- 10
- 45
- 66