API Documentation

Zend/Oauth/Http.php

Show: inherited
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-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Oauth  
Version
$Id: Http.php 24594 2012-01-05 21:27:01Z matthew $  

\Zend_Oauth_Http

Package: Zend\Oauth

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

Propertyprotectedstring  $_consumer= 'null'

Reference to the Zend_Oauth_Consumer instance in use.

Default valuenullDetails
Type
string
Propertyprotected\Zend_Oauth_Http_Utility  $_httpUtility= 'null'

Instance of the general Zend_Oauth_Http_Utility class.

Default valuenullDetails
Type
\Zend_Oauth_Http_Utility
Propertyprotectedarray  $_parameters= 'array()'

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

Default valuearray()Details
Type
array
Propertyprotectedstring  $_preferredRequestMethod= 'Zend_Oauth::POST'

Request Method for the HTTP Request.

Default valueZend_Oauth::POSTDetails
Type
string
Propertyprotectedstring  $_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.

Default valuenullDetails
Type
string

Methods

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

Constructor

Parameters
Name Type Description
$consumer \Zend_Oauth_Consumer
$parameters null|array
$utility null|\Zend_Oauth_Http_Utility
methodprotected_assessRequestAttempt(  $response = null ) : void

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

Parameters
Name Type Description
$response

Zend_Http_Response

Throws
Exception Description
\Zend_Oauth_Exception if unable to retrieve valid token response
methodprotected_toAuthorizationHeader( array $params, string $realm = null ) : string

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

Parameters
Name Type Description
$params array
$realm string
Returns
Type Description
string
methodpublicgetConsumer( ) : \Zend_Oauth_Consumer

Return the Consumer instance in use.

Returns
Type Description
\Zend_Oauth_Consumer
methodpublicgetMethod( ) : string

Preferred HTTP request method accessor.

Returns
Type Description
string
methodpublicgetParameters( ) : array

Accessor for an array of custom parameters.

Returns
Type Description
array
methodpublicgetRequestSchemeQueryStringClient( 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.

Parameters
Name Type Description
$params array
$url string
Returns
Type Description
\Zend_Http_Client
methodpublicsetMethod( string $method ) : \Zend_Oauth_Http

Set a preferred HTTP request method.

Parameters
Name Type Description
$method string
Returns
Type Description
\Zend_Oauth_Http
methodpublicsetParameters( array $customServiceParameters ) : \Zend_Oauth_Http

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

Parameters
Name Type Description
$customServiceParameters array
Returns
Type Description
\Zend_Oauth_Http
methodpublicstartRequestCycle( 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.

Parameters
Name Type Description
$params array
Returns
Type Description
\Zend_Http_Response
Throws
Exception Description
\Zend_Oauth_Exception on HTTP request errors
Details
Todo
Remove cycling?; Replace with upfront do-or-die configuration  
Documentation was generated by DocBlox 0.15.1.