category | Zend |
---|---|
package | Zend_Rest |
subpackage | Client |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
inherited_from | \Zend_Service_Abstract |
__call(string $method, array $args) : \Zend_Rest_Client_Result | \Zend_Rest_Client
Allows calling REST actions as object methods; however, you must
follow-up by chaining the request with a request to an HTTP request
method (post, get, delete, put):
$response = $rest->sayHello('Foo', 'Manchu')->get();
Or use them together, but in sequential calls:
$rest->sayHello('Foo', 'Manchu');
$response = $rest->get();
string
Method name
array
Method args
\Zend_Rest_Client_Result
\Zend_Rest_Client
Zend_Rest_Client if using
a remote method, Zend_Rest_Client_Result if using an HTTP request method__construct(string|\Zend_Uri_Http $uri = null
) : void
string
\Zend_Uri_Http
URI for the web service
getHttpClient() : \Zend_Http_Client
\Zend_Http_Client
getUri() : \Zend_Uri_Http
\Zend_Uri_Http
restDelete(string $path, $data = null
) : \Zend_Http_Response
string
\Zend_Http_Client_Exception |
---|
\Zend_Http_Response
restGet(string $path, array $query = null
) : \Zend_Http_Response
string
array
Array of GET parameters
\Zend_Http_Client_Exception |
---|
\Zend_Http_Response
restPost(string $path, mixed $data = null
) : \Zend_Http_Response
string
mixed
Raw data to send
\Zend_Http_Client_Exception |
---|
\Zend_Http_Response
restPut(string $path, mixed $data = null
) : \Zend_Http_Response
string
mixed
Raw data to send in request
\Zend_Http_Client_Exception |
---|
\Zend_Http_Response
setHttpClient(\Zend_Http_Client $httpClient)
\Zend_Http_Client
setNoReset(boolean $bool = true
)
Parameters will accumulate between requests, but as soon as you do not call this function prior to any request, all preset parameters will be reset as by default.
boolean
setUri(string|\Zend_Uri_Http $uri) : \Zend_Rest_Client
string
\Zend_Uri_Http
URI for the web service
\Zend_Rest_Client
_performPost(mixed $method, mixed $data = null
) : \Zend_Http_Response
Performs a POST or PUT request. Any data provided is set in the HTTP client. String data is pushed in as raw POST data; array or object data is pushed in as POST parameters.
mixed
mixed
\Zend_Http_Response
_prepareRest(string $path) : void
string
The path to append to the URI
\Zend_Rest_Client_Exception |
---|
$_data : array
array()
$_httpClient : \Zend_Http_Client
null
$_noReset : boolean
false
Must be set explicitly if you want to keep preset parameters.
$_uri : \Zend_Uri_Http
null