Definition at line 34 of file Http.php.
◆ __construct()
Constructor
- Parameters
-
- Returns
- void
Definition at line 82 of file Http.php.
87 $this->_consumer = $consumer;
88 $this->_preferredRequestScheme = $this->_consumer->getRequestScheme();
89 if ($parameters !==
null) {
92 if ($utility !==
null) {
93 $this->_httpUtility = $utility;
setParameters(array $customServiceParameters)
◆ _assessRequestAttempt()
Manages the switch from OAuth request scheme to another lower preference scheme during a request cycle.
- Parameters
-
- Returns
- void
- Exceptions
-
Definition at line 223 of file Http.php.
225 switch ($this->_preferredRequestScheme) {
233 #require_once 'Zend/Oauth/Exception.php'; 235 'Could not retrieve a valid Token response from Token URL:' 238 :
' No body - check for headers')
const REQUEST_SCHEME_HEADER
const REQUEST_SCHEME_QUERYSTRING
const REQUEST_SCHEME_POSTBODY
◆ _toAuthorizationHeader()
_toAuthorizationHeader |
( |
array |
$params, |
|
|
|
$realm = null |
|
) |
| |
|
protected |
Generates a valid OAuth Authorization header based on the provided parameters and realm.
- Parameters
-
array | $params | |
string | $realm | |
- Returns
- string
Definition at line 251 of file Http.php.
253 $headerValue = array();
254 $headerValue[] =
'OAuth realm="' . $realm .
'"';
256 if (!preg_match(
"/^oauth_/", $key)) {
264 return implode(
",", $headerValue);
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
◆ getConsumer()
◆ getMethod()
Preferred HTTP request method accessor.
- Returns
- string
Definition at line 120 of file Http.php.
◆ getParameters()
Accessor for an array of custom parameters.
- Returns
- array
Definition at line 142 of file Http.php.
◆ getRequestSchemeQueryStringClient()
getRequestSchemeQueryStringClient |
( |
array |
$params, |
|
|
|
$url |
|
) |
| |
Return an instance of Zend_Http_Client configured to use the Query String scheme for an OAuth driven HTTP request.
- Parameters
-
- Returns
- Zend_Http_Client
Definition at line 204 of file Http.php.
207 $client->setUri(
$url);
208 $client->getUri()->setQuery(
209 $this->_httpUtility->toEncodedQueryString(
$params)
211 $client->setMethod($this->_preferredRequestMethod);
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
◆ setMethod()
Set a preferred HTTP request method.
- Parameters
-
- Returns
- Zend_Oauth_Http
Definition at line 105 of file Http.php.
108 #require_once 'Zend/Oauth/Exception.php'; 111 $this->_preferredRequestMethod =
$method;
◆ setParameters()
setParameters |
( |
array |
$customServiceParameters | ) |
|
Mutator to set an array of custom parameters for the HTTP request.
- Parameters
-
array | $customServiceParameters | |
- Returns
- Zend_Oauth_Http
Definition at line 131 of file Http.php.
133 $this->_parameters = $customServiceParameters;
◆ startRequestCycle()
startRequestCycle |
( |
array |
$params | ) |
|
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
-
- Returns
- Zend_Http_Response
- Exceptions
-
- Todo:
- Remove cycling?; Replace with upfront do-or-die configuration
Definition at line 169 of file Http.php.
177 #require_once 'Zend/Oauth/Exception.php';
_assessRequestAttempt(Zend_Http_Response $response=null)
startRequestCycle(array $params)
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE]
◆ $_consumer
◆ $_httpUtility
◆ $_parameters
◆ $_preferredRequestMethod
◆ $_preferredRequestScheme
$_preferredRequestScheme = null |
|
protected |
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Oauth/Http.php