Caution: The documentation you are viewing is
for an older version of Zend Framework.
You can find the documentation of the current version at:
https://docs.zendframework.com/
Zend_Rest_Server - Zend_Rest
Zend_Rest_Server is intended as a fully-featured REST server.
Example #1 Basic Zend_Rest_Server Usage - Classes
Example #2 Basic Zend_Rest_Server Usage - Functions
To call a Zend_Rest_Server service, you must supply a
GET/POST method
argument with a value that is the
method you wish to call. You can then follow that up with any number
of arguments using either the name of the argument (i.e. "who") or
using arg
following by the numeric position of the
argument (i.e. "arg1").
Note: Numeric index
Numeric arguments use a 1-based index.
To call sayHello
from the example above, you can use either:
?method=sayHello&who=Davey&when=Day
or:
?method=sayHello&arg1=Davey&arg2=Day
When returning values, to return a custom status, you may return an
array with a status
key.
Example #3 Returning Custom Status
If you wish to return custom XML, simply return a
DOMDocument
, DOMElement
or
SimpleXMLElement
object.
Example #4 Return Custom XML
The response from the service will be returned without modification to the client.