API Documentation

Oauth/Http.php

Includes Classes 
category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Oauth
version
$Id: Http.php 20232 2010-01-12 17:56:33Z matthew $
Classes
Zend_Oauth_Http

Description

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.

Zend_Oauth_Http

category
Zend
copyright
Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
license
http://framework.zend.com/license/new-bsd New BSD License
package
Zend_Oauth
Properties
$_parameters
$_consumer
$_preferredRequestScheme
$_preferredRequestMethod
$_httpUtility
Methods
__construct
setMethod
getMethod
setParameters
getParameters
getConsumer
startRequestCycle
getRequestSchemeQueryStringClient
_assessRequestAttempt
_toAuthorizationHeader

Description

Properties

$_consumer

string $_consumer = 'null'

Reference to the Zend_Oauth_Consumer instance in use.

Details

$_consumer
string
visibility
protected
default
null
final
false
static
false

$_httpUtility

Zend_Oauth_Http_Utility $_httpUtility = 'null'

Instance of the general Zend_Oauth_Http_Utility class.

Details

$_httpUtility
Zend_Oauth_Http_Utility
visibility
protected
default
null
final
false
static
false

$_parameters

array $_parameters = 'array'

Array of all custom service parameters to be sent in the HTTP request in addition to the usual OAuth parameters.

Details

$_parameters
array
visibility
protected
default
array
final
false
static
false

$_preferredRequestMethod

string $_preferredRequestMethod = 'Zend_Oauth'

Request Method for the HTTP Request.

Details

$_preferredRequestMethod
string
visibility
protected
default
Zend_Oauth
final
false
static
false

$_preferredRequestScheme

string $_preferredRequestScheme = 'null'

OAuth specifies three request methods, this holds the current preferred one which by default uses the Authorization Header approach for passing OAuth parameters, and a POST body for non-OAuth custom parameters.

Details

$_preferredRequestScheme
string
visibility
protected
default
null
final
false
static
false

Methods

__construct

__construct( Zend_Oauth_Consumer $consumer, null|array $parameters = null, null|Zend_Oauth_Http_Utility $utility = null ) : void

Constructor

Arguments
$consumer
Zend_Oauth_Consumer
$parameters
nullarray
$utility
nullZend_Oauth_Http_Utility
Details
visibility
public
final
false
static
false

_assessRequestAttempt

_assessRequestAttempt(  $response = null ) : void

Manages the switch from OAuth request scheme to another lower preference scheme during a request cycle.

Arguments
$response
Zend_Http_Response
Details
visibility
protected
final
false
static
false
throws
if unable to retrieve valid token response

_toAuthorizationHeader

_toAuthorizationHeader( array $params, string $realm = null ) : string

Generates a valid OAuth Authorization header based on the provided parameters and realm.

Arguments
$params
array
$realm
string
Output
string
Details
visibility
protected
final
false
static
false

getConsumer

getConsumer( ) : Zend_Oauth_Consumer

Return the Consumer instance in use.

Details
visibility
public
final
false
static
false

getMethod

getMethod( ) : string

Preferred HTTP request method accessor.

Output
string
Details
visibility
public
final
false
static
false

getParameters

getParameters( ) : array

Accessor for an array of custom parameters.

Output
array
Details
visibility
public
final
false
static
false

getRequestSchemeQueryStringClient

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.

Arguments
$params
array
$url
string
Details
visibility
public
final
false
static
false

setMethod

setMethod( string $method ) : Zend_Oauth_Http

Set a preferred HTTP request method.

Arguments
$method
string
Details
visibility
public
final
false
static
false

setParameters

setParameters( array $customServiceParameters ) : Zend_Oauth_Http

Mutator to set an array of custom parameters for the HTTP request.

Arguments
$customServiceParameters
array
Details
visibility
public
final
false
static
false

startRequestCycle

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.

Arguments
$params
array
Details
visibility
public
final
false
static
false
throws
on HTTP request errors
todo
Remove cycling?; Replace with upfront do-or-die configuration
Documentation was generated by DocBlox.