OAuth::getRequestHeader
(No version information available, might only be in Git)
OAuth::getRequestHeader — Generate OAuth header string signature
Description
public string OAuth::getRequestHeader
( string
$http_method
, string $url
[, mixed $extra_parameters
] )Generate OAuth header string signature based on the final HTTP method, URL and a string/array of parameters
Parameters
-
http_method
-
HTTP method for request.
-
url
-
URL for request.
-
extra_parameters
-
String or array of additional parameters.
Return Values
A string containing the generated request header or FALSE
on failure
- Функция OAuth::__construct() - Create a new OAuth object
- Функция OAuth::__destruct() - The destructor
- Функция OAuth::disableDebug() - Turn off verbose debugging
- Функция OAuth::disableRedirects() - Turn off redirects
- Функция OAuth::disableSSLChecks() - Turn off SSL checks
- Функция OAuth::enableDebug() - Turn on verbose debugging
- Функция OAuth::enableRedirects() - Turn on redirects
- Функция OAuth::enableSSLChecks() - Turn on SSL checks
- Функция OAuth::fetch() - Fetch an OAuth protected resource
- Функция OAuth::generateSignature() - Generate a signature
- Функция OAuth::getAccessToken() - Fetch an access token
- Функция OAuth::getCAPath() - Gets CA information
- Функция OAuth::getLastResponse() - Get the last response
- Функция OAuth::getLastResponseHeaders() - Get headers for last response
- Функция OAuth::getLastResponseInfo() - Get HTTP information about the last response
- Функция OAuth::getRequestHeader() - Generate OAuth header string signature
- Функция OAuth::getRequestToken() - Fetch a request token
- Функция OAuth::setAuthType() - Set authorization type
- Функция OAuth::setCAPath() - Set CA path and info
- Функция OAuth::setNonce() - Set the nonce for subsequent requests
- Функция OAuth::setRequestEngine() - The setRequestEngine purpose
- Функция OAuth::setRSACertificate() - Set the RSA certificate
- Функция OAuth::setSSLChecks() - Tweak specific SSL checks for requests.
- Функция OAuth::setTimestamp() - Set the timestamp
- Функция OAuth::setToken() - Sets the token and secret
- Функция OAuth::setVersion() - Set the OAuth version
Коментарии
The documentation does not specify the difference between passing a string and passing an array for the third parameter. We spent two days debugging before reading the C source code to figure out that there is a significant and undocumented difference between the two.
"a=1" and array("a" => 1) are handled very differently!
If you are making a POST/PUT request (or anything with an entity body) then you should pass that as a string.
If you are making a request with a query string, you should pass that as an associative array.
If you pass "a=1" intending that to specify the query string, the generated signature will be invalid -- it will process this as if you were POSTing the content "a=1" instead.