本文整理匯總了PHP中League\OAuth2\Client\Provider\AbstractProvider::getHeaders方法的典型用法代碼示例。如果您正苦於以下問題:PHP AbstractProvider::getHeaders方法的具體用法?PHP AbstractProvider::getHeaders怎麽用?PHP AbstractProvider::getHeaders使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類League\OAuth2\Client\Provider\AbstractProvider
的用法示例。
在下文中一共展示了AbstractProvider::getHeaders方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getHeaders
public function getHeaders($token = NULL, $username = NULL, $password = NULL)
{
$headers = parent::getHeaders($token);
$headers['x-myobapi-key'] = $this->clientId;
if ($username) {
$headers['x-myobapi-cftoken'] = base64_encode($username . ":" . $password);
}
return $headers;
}
示例2: getDefaultHeaders
public function getDefaultHeaders($token = null)
{
$headers = parent::getHeaders($token);
$headers['Accept'] = 'application/hal+json';
return $headers;
}
示例3: getHeaders
/**
* {@inheritDoc}
*/
public function getHeaders($token = null)
{
$this->validateUserAgent();
$headers = ["User-Agent" => $this->getUserAgent()];
// We have to use HTTP Basic Auth when requesting an access token
if (!$token) {
$auth = base64_encode("{$this->clientId}:{$this->clientSecret}");
$headers["Authorization"] = "Basic {$auth}";
}
return array_merge(parent::getHeaders($token), $headers);
}
示例4: getHeaders
public function getHeaders($token = null)
{
$headers = parent::getHeaders($token);
return array_merge($headers, ['X-Fortifi-Org' => $this->_orgFid]);
}