Oauth/Http.php
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-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
- Package
- Zend_Oauth
- Version
- $Id: Http.php 24593 2012-01-05 20:35:02Z matthew $
\Zend_Oauth_Http
- Children
- \Zend_Oauth_Http_RequestToken
- \Zend_Oauth_Http_AccessToken
- \Zend_Oauth_Http_UserAuthorization
- Category
- Zend
- Copyright
- Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- License
- New BSD License
Properties


string $_consumer = null
null
Details- Type
- string


\Zend_Oauth_Http_Utility $_httpUtility = null
null
Details

array $_parameters = array()
array()
Details- Type
- array


string $_preferredRequestMethod = \Zend_Oauth::POST
\Zend_Oauth::POST
Details- Type
- string
Methods


__construct(\Zend_Oauth_Consumer $consumer, null | array $parameters = null, null | \Zend_Oauth_Http_Utility $utility = null) : void
Constructor
Name | Type | Description |
---|---|---|
$consumer | \Zend_Oauth_Consumer | |
$parameters | null | array | |
$utility | null | \Zend_Oauth_Http_Utility |


_assessRequestAttempt(\Zend_Http_Response $response = null) : void
Manages the switch from OAuth request scheme to another lower preference scheme during a request cycle.
Name | Type | Description |
---|---|---|
$response | \Zend_Http_Response |
Exception | Description |
---|---|
\Zend_Oauth_Exception | if unable to retrieve valid token response |


_toAuthorizationHeader(array $params, string $realm = null) : string
Generates a valid OAuth Authorization header based on the provided parameters and realm.
Name | Type | Description |
---|---|---|
$params | array | |
$realm | string |
Type | Description |
---|---|
string |


getConsumer() : \Zend_Oauth_Consumer
Return the Consumer instance in use.
Type | Description |
---|---|
\Zend_Oauth_Consumer |


getRequestSchemeQueryStringClient(array $params, string $url) : \Zend_Http_Client
Return an instance of Zend_Http_Client configured to use the Query String scheme for an OAuth driven HTTP request.
Name | Type | Description |
---|---|---|
$params | array | |
$url | string |
Type | Description |
---|---|
\Zend_Http_Client |


setMethod(string $method) : \Zend_Oauth_Http
Set a preferred HTTP request method.
Name | Type | Description |
---|---|---|
$method | string |
Type | Description |
---|---|
\Zend_Oauth_Http |


setParameters(array $customServiceParameters) : \Zend_Oauth_Http
Mutator to set an array of custom parameters for the HTTP request.
Name | Type | Description |
---|---|---|
$customServiceParameters | array |
Type | Description |
---|---|
\Zend_Oauth_Http |


startRequestCycle(array $params) : \Zend_Http_Response
Commence a request cycle where the current HTTP method and OAuth request scheme set an upper preferred HTTP request style and where failures generate a new HTTP request style further down the OAuth preference list for OAuth Request Schemes.
On success, return the Request object that results for processing.
Name | Type | Description |
---|---|---|
$params | array |
Type | Description |
---|---|
\Zend_Http_Response |
Exception | Description |
---|---|
\Zend_Oauth_Exception | on HTTP request errors |
- Todo
- Remove cycling?; Replace with upfront do-or-die configuration