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

 Methods

Method call overload

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

Parameters

$method

string

Method name

$args

array

Method args

Returns

\Zend_Rest_Client_Result\Zend_Rest_ClientZend_Rest_Client if using a remote method, Zend_Rest_Client_Result if using an HTTP request method

Constructor

__construct(string|\Zend_Uri_Http $uri = null) : void

Parameters

$uri

string\Zend_Uri_Http

URI for the web service

Gets the HTTP client object.

getHttpClient() : \Zend_Http_Client
InheritedStatic

Returns

\Zend_Http_Client

Retrieve the current request URI object

getUri() : \Zend_Uri_Http

Returns

\Zend_Uri_Http

Performs an HTTP DELETE request to $path.

restDelete(string $path, $data = null) : \Zend_Http_Response

Parameters

$path

string

$data

Exceptions

\Zend_Http_Client_Exception

Returns

\Zend_Http_Response

Performs an HTTP GET request to the $path.

restGet(string $path, array $query = null) : \Zend_Http_Response

Parameters

$path

string

$query

array

Array of GET parameters

Exceptions

\Zend_Http_Client_Exception

Returns

\Zend_Http_Response

Performs an HTTP POST request to $path.

restPost(string $path, mixed $data = null) : \Zend_Http_Response

Parameters

$path

string

$data

mixed

Raw data to send

Exceptions

\Zend_Http_Client_Exception

Returns

\Zend_Http_Response

Performs an HTTP PUT request to $path.

restPut(string $path, mixed $data = null) : \Zend_Http_Response

Parameters

$path

string

$data

mixed

Raw data to send in request

Exceptions

\Zend_Http_Client_Exception

Returns

\Zend_Http_Response

Sets the HTTP client object to use for retrieving the feeds. If none is set, the default Zend_Http_Client will be used.

setHttpClient(\Zend_Http_Client $httpClient) 
InheritedStatic

Parameters

$httpClient

\Zend_Http_Client

Tells Zend_Rest_Client not to reset all parameters on it's Zend_Http_Client. If you want no reset, this must be called explicitly before every request for which you do not want to reset the parameters.

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.

Parameters

$bool

boolean

Set the URI to use in the request

setUri(string|\Zend_Uri_Http $uri) : \Zend_Rest_Client

Parameters

$uri

string\Zend_Uri_Http

URI for the web service

Returns

\Zend_Rest_Client

Perform a POST or PUT

_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.

Parameters

$method

mixed

$data

mixed

Returns

\Zend_Http_Response

Call a remote REST web service URI and return the Zend_Http_Response object

_prepareRest(string $path) : void

Parameters

$path

string

The path to append to the URI

Exceptions

\Zend_Rest_Client_Exception

 Properties

 

Data for the query

$_data : array

Default

array()
 

HTTP Client used to query all web services

$_httpClient : \Zend_Http_Client

Default

null
Static
 

Flag indicating the Zend_Http_Client is fresh and needs no reset.

$_noReset : boolean

Default

false

Must be set explicitly if you want to keep preset parameters.

 

Zend_Uri of this web service

$_uri : \Zend_Uri_Http

Default

null