Rest/Client.php

Show: PublicProtectedPrivateinherited
Table of Contents
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-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Rest  
Subpackage
Client  
Version
$Id$  

\Zend_Rest_Client

Package: Zend_Rest\Client
Parent(s)
\Zend_Service_Abstract
Category
Zend  
Copyright
Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Properties

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
NameTypeDescription
$methodstring

Method name

$argsarray

Method args

Returns
TypeDescription
\Zend_Rest_Client_Result | \Zend_Rest_ClientZend_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
NameTypeDescription
$uristring | \Zend_Uri_Http

URI for the web service

methodpublicgetUri() : \Zend_Uri_Http

Retrieve the current request URI object

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

Performs an HTTP DELETE request to $path.

Parameters
NameTypeDescription
$pathstring
$data
Returns
TypeDescription
\Zend_Http_Response
Throws
ExceptionDescription
\Zend_Http_Client_Exception
methodpublicrestGet(string $path, array $query = null) : \Zend_Http_Response

Performs an HTTP GET request to the $path.

Parameters
NameTypeDescription
$pathstring
$queryarray

Array of GET parameters

Returns
TypeDescription
\Zend_Http_Response
Throws
ExceptionDescription
\Zend_Http_Client_Exception
methodpublicrestPost(string $path, mixed $data = null) : \Zend_Http_Response

Performs an HTTP POST request to $path.

Parameters
NameTypeDescription
$pathstring
$datamixed

Raw data to send

Returns
TypeDescription
\Zend_Http_Response
Throws
ExceptionDescription
\Zend_Http_Client_Exception
methodpublicrestPut(string $path, mixed $data = null) : \Zend_Http_Response

Performs an HTTP PUT request to $path.

Parameters
NameTypeDescription
$pathstring
$datamixed

Raw data to send in request

Returns
TypeDescription
\Zend_Http_Response
Throws
ExceptionDescription
\Zend_Http_Client_Exception
methodpublicsetNoReset(boolean $bool = true) : void

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.

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
NameTypeDescription
$boolboolean
methodpublicsetUri(string | \Zend_Uri_Http $uri) : \Zend_Rest_Client

Set the URI to use in the request

Parameters
NameTypeDescription
$uristring | \Zend_Uri_Http

URI for the web service

Returns
TypeDescription
\Zend_Rest_Client
Documentation was generated by phpDocumentor 2.2.0 .