Class Zend_Gdata_HttpClient

Description

Gdata Http Client object.

Class to extend the generic Zend Http Client with the ability to perform secure AuthSub requests

  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Gdata/HttpClient.php (line 40)

Zend_Http_Client
   |
   --Zend_Gdata_HttpClient
Variable Summary
Method Summary
 array filterHttpRequest (string $method, string $url, [array $headers = array()], [string $body = null], [string $contentType = null])
 string getAuthSubToken ()
 boolean getStreamingRequest ()
 Zend_Http_Client resetParameters ([ $clearAll = false])
 Zend_Gdata_HttpClient setAuthSubPrivateKey (string $key, [string $passphrase = null])
 void setAuthSubPrivateKeyFile (string $file, [string $passphrase = null], [bool $useIncludePath = false])
 Zend_Http_Client setRawDataStream (string $data, [string $enctype = null])
 void setStreamingRequest (boolean $value)
 string _prepareBody ()
Variables
Methods
filterHttpRequest (line 207)

Filters the HTTP requests being sent to add the Authorization header.

If both AuthSub and ClientLogin tokens are set, AuthSub takes precedence. If an AuthSub key is set, then secure AuthSub authentication is used, and the request is signed. Requests must be signed only with the private key corresponding to the public key registered with Google. If an AuthSub key is set, but openssl support is not enabled in the PHP installation, an exception is thrown.

  • return: The processed values in an associative array, using the same names as the params
  • throws: Zend_Gdata_App_Exception if there was a signing failure
  • access: public
array filterHttpRequest (string $method, string $url, [array $headers = array()], [string $body = null], [string $contentType = null])
  • string $method: The HTTP method
  • string $url: The URL
  • array $headers: An associate array of headers to be sent with the request or null
  • string $body: The body of the request or null
  • string $contentType: The MIME content type of the body or null
filterHttpResponse (line 250)

Method for filtering the HTTP response, though no filtering is currently done.

  • return: The filterd response object
  • access: public
Zend_Http_Response filterHttpResponse (Zend_Http_Response $response)
getAdapter (line 259)

Return the current connection adapter

  • access: public
Zend_Http_Client_Adapter_Interface|string getAdapter ()

Redefinition of:
Zend_Http_Client::getAdapter()
Load the connection adapter
getAuthSubPrivateKeyId (line 142)

Gets the openssl private key id

  • return: The private key
  • access: public
string getAuthSubPrivateKeyId ()
getAuthSubToken (line 151)

Gets the AuthSub token used for authentication

  • return: The token
  • access: public
string getAuthSubToken ()
getClientLoginToken (line 171)

Gets the ClientLogin token used for authentication

  • return: The token
  • access: public
string getClientLoginToken ()
getStreamingRequest (line 296)

Check whether the client is set to perform streaming requests.

  • return: True if yes, false otherwise.
  • access: public
boolean getStreamingRequest ()
resetParameters (line 328)

Clear all custom parameters we set.

  • access: public
Zend_Http_Client resetParameters ([ $clearAll = false])
  • $clearAll

Redefinition of:
Zend_Http_Client::resetParameters()
Clear all GET and POST parameters
setAdapter (line 270)

Load the connection adapter

  • access: public
void setAdapter (Zend_Http_Client_Adapter_Interface $adapter)

Redefinition of:
Zend_Http_Client::setAdapter()
Load the connection adapter
setAuthSubPrivateKey (line 125)

Sets the PEM formatted private key to be used for secure AuthSub auth.

In order to call this method, openssl must be enabled in your PHP installation. Otherwise, a Zend_Gdata_App_InvalidArgumentException will be thrown.

  • return: Provides a fluent interface
  • throws: Zend_Gdata_App_InvalidArgumentException
  • access: public
Zend_Gdata_HttpClient setAuthSubPrivateKey (string $key, [string $passphrase = null])
  • string $key: The private key
  • string $passphrase: The optional private key passphrase
setAuthSubPrivateKeyFile (line 97)

Sets the PEM formatted private key, as read from a file.

This method reads the file and then calls setAuthSubPrivateKey() with the file contents.

  • access: public
void setAuthSubPrivateKeyFile (string $file, [string $passphrase = null], [bool $useIncludePath = false])
  • string $file: The location of the file containing the PEM key
  • string $passphrase: The optional private key passphrase
  • bool $useIncludePath: Whether to search the include_path for the file
setAuthSubToken (line 161)

Sets the AuthSub token used for authentication

  • return: Provides a fluent interface
  • access: public
Zend_Gdata_HttpClient setAuthSubToken (string $token)
  • string $token: The token
setClientLoginToken (line 181)

Sets the ClientLogin token used for authentication

  • return: Provides a fluent interface
  • access: public
Zend_Gdata_HttpClient setClientLoginToken (string $token)
  • string $token: The token
setRawDataStream (line 346)

Set the raw (already encoded) POST data from a stream source.

This is used to support POSTing from open file handles without caching the entire body into memory. It is a wrapper around Zend_Http_Client::setRawData().

  • access: public
Zend_Http_Client setRawDataStream (string $data, [string $enctype = null])
  • string $data: The request data
  • string $enctype: The encoding type
setStreamingRequest (line 286)

Set the streamingRequest variable which controls whether we are sending the raw (already encoded) POST data from a stream source.

  • access: public
void setStreamingRequest (boolean $value)
  • boolean $value: The value to set.
_prepareBody (line 311)

Prepare the request body (for POST and PUT requests)

  • throws: Zend_Http_Client_Exception
  • access: protected
string _prepareBody ()

Redefinition of:
Zend_Http_Client::_prepareBody()
Prepare the request body (for POST and PUT requests)

Inherited Methods

Inherited From Zend_Http_Client

 Zend_Http_Client::__construct()
 Zend_Http_Client::encodeAuthHeader()
 Zend_Http_Client::encodeFormData()
 Zend_Http_Client::getAdapter()
 Zend_Http_Client::getCookieJar()
 Zend_Http_Client::getHeader()
 Zend_Http_Client::getLastRequest()
 Zend_Http_Client::getLastResponse()
 Zend_Http_Client::getRedirectionsCount()
 Zend_Http_Client::getStream()
 Zend_Http_Client::getUri()
 Zend_Http_Client::request()
 Zend_Http_Client::resetParameters()
 Zend_Http_Client::setAdapter()
 Zend_Http_Client::setAuth()
 Zend_Http_Client::setConfig()
 Zend_Http_Client::setCookie()
 Zend_Http_Client::setCookieJar()
 Zend_Http_Client::setEncType()
 Zend_Http_Client::setFileUpload()
 Zend_Http_Client::setHeaders()
 Zend_Http_Client::setMethod()
 Zend_Http_Client::setParameterGet()
 Zend_Http_Client::setParameterPost()
 Zend_Http_Client::setRawData()
 Zend_Http_Client::setStream()
 Zend_Http_Client::setUri()
 Zend_Http_Client::_detectFileMimeType()
 Zend_Http_Client::_flattenParametersArray()
 Zend_Http_Client::_getParametersRecursive()
 Zend_Http_Client::_openTempStream()
 Zend_Http_Client::_prepareBody()
 Zend_Http_Client::_prepareHeaders()
 Zend_Http_Client::_setParameter()
Class Constants

Documentation generated on Mon, 21 Jun 2010 15:27:40 -0400 by phpDocumentor 1.4.3