API Documentation

Rest/Client.php

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Rest  
subpackage
Client  
version
$Id: Client.php 24274 2011-07-28 09:25:31Z mcleod@spaceweb.nl $  

\Zend_Rest_Client

Extends from
\Zend_Service_Abstract
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Rest  
subpackage
Client  

Properties

Propertyprotectedarray  $_data= 'array'

Data for the query

Default valuearrayDetails
Type
array
Propertyprotected\Zend_Uri_Http  $_uri= 'null'

Zend_Uri of this web service

Default valuenullDetails
Type
\Zend_Uri_Http

Methods

methodpublic__call( string $method, array $args ) : \Zend_Rest_Client_Result|\Zend_Rest_Client

Method call overload

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
Name Type Description
$method string Method name
$args array Method args
Returns
Type Description
\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
methodpublic__construct( string|\Zend_Uri_Http $uri = null ) : void

Constructor

Parameters
Name Type Description
$uri string|\Zend_Uri_Http URI for the web service
methodprotected_performPost( mixed $method, mixed $data = null ) : \Zend_Http_Response

Perform a POST or PUT

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
Name Type Description
$method mixed
$data mixed
Returns
Type Description
\Zend_Http_Response
methodprivate_prepareRest( string $path ) : void

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

Parameters
Name Type Description
$path string The path to append to the URI
Throws
Exception Description
\Zend_Rest_Client_Exception
methodpublicgetHttpClient( ) : \Zend_Http_Client
static

Gets the HTTP client object.

Inherited from: \Zend_Service_Abstract::getHttpClient()
Returns
Type Description
\Zend_Http_Client
methodpublicgetUri( ) : \Zend_Uri_Http

Retrieve the current request URI object

Returns
Type Description
\Zend_Uri_Http
methodpublicrestDelete( string $path,  $data = null ) : \Zend_Http_Response

Performs an HTTP DELETE request to $path.

Parameters
Name Type Description
$path string
$data
Returns
Type Description
\Zend_Http_Response
Throws
Exception Description
\Zend_Http_Client_Exception
methodpublicrestGet( string $path, array $query = null ) : \Zend_Http_Response

Performs an HTTP GET request to the $path.

Parameters
Name Type Description
$path string
$query array Array of GET parameters
Returns
Type Description
\Zend_Http_Response
Throws
Exception Description
\Zend_Http_Client_Exception
methodpublicrestPost( string $path, mixed $data = null ) : \Zend_Http_Response

Performs an HTTP POST request to $path.

Parameters
Name Type Description
$path string
$data mixed Raw data to send
Returns
Type Description
\Zend_Http_Response
Throws
Exception Description
\Zend_Http_Client_Exception
methodpublicrestPut( string $path, mixed $data = null ) : \Zend_Http_Response

Performs an HTTP PUT request to $path.

Parameters
Name Type Description
$path string
$data mixed Raw data to send in request
Returns
Type Description
\Zend_Http_Response
Throws
Exception Description
\Zend_Http_Client_Exception
methodpublicsetHttpClient( \Zend_Http_Client $httpClient ) : void
static

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

Inherited from: \Zend_Service_Abstract::setHttpClient()
Parameters
Name Type Description
$httpClient \Zend_Http_Client
methodpublicsetUri( string|\Zend_Uri_Http $uri ) : \Zend_Rest_Client

Set the URI to use in the request

Parameters
Name Type Description
$uri string|\Zend_Uri_Http URI for the web service
Returns
Type Description
\Zend_Rest_Client
Documentation was generated by DocBlox 0.13.3.