Class to represent an OAuth request.
More...
|
string | $base_string |
| Base string.
|
|
|
static string | $version = '1.0' |
| Version.
|
|
static string | $POST_INPUT = 'php://input' |
| Access to POST data.
|
|
|
array | $parameters |
| Request parameters.
|
|
string | $http_method |
| HTTP method.
|
|
string | $http_url |
| HTTP URL.
|
|
Class to represent an OAuth request.
- Copyright
- Andy Smith (http://oauth.googlecode.com/svn/code/php/)
- Version
- 2008-08-04
- Licence: https://opensource.org/licenses/MIT The MIT License
◆ __construct()
__construct |
( |
string | $http_method, |
|
|
string | $http_url, |
|
|
?array | $parameters = null ) |
Class constructor.
- Parameters
-
string | $http_method | HTTP method |
string | $http_url | HTTP URL |
array | null | $parameters | Request parameters |
◆ __toString()
Convert object to a string.
- Returns
- string
◆ build_signature()
Build the signature.
- Parameters
-
OAuthSignatureMethod | $signature_method | Signature method |
OAuthConsumer | $consumer | Consumer |
OAuthToken | null | $token | Token |
- Returns
- string
◆ from_consumer_and_token()
Pretty much a helper function to set up the request.
- Parameters
-
OAuthConsumer | $consumer | Consumer |
OAuthToken | null | $token | Token |
string | $http_method | HTTP method |
string | $http_url | HTTP URL |
array | null | $parameters | Request parameters |
- Returns
- OAuthRequest
◆ from_request()
static OAuthRequest from_request |
( |
?string | $http_method = null, |
|
|
?string | $http_url = null, |
|
|
?array | $parameters = null ) |
|
static |
◆ get_normalized_http_method()
string get_normalized_http_method |
( |
| ) |
|
◆ get_normalized_http_url()
string get_normalized_http_url |
( |
| ) |
|
◆ get_parameter()
string array null get_parameter |
( |
string | $name | ) |
|
Get a parameter.
- Parameters
-
string | $name | Parameter name |
- Returns
- string|array|null
◆ get_parameters()
Get request parameters.
- Returns
- array
◆ get_signable_parameters()
string get_signable_parameters |
( |
| ) |
|
The request parameters, sorted and concatenated into a normalized string.
- Returns
- string
◆ get_signature_base_string()
string get_signature_base_string |
( |
| ) |
|
Returns the base string of this request.
The base string defined as the method, the url and the parameters (normalized), each urlencoded and then concatenated with &.
- Returns
- string
◆ set_parameter()
void set_parameter |
( |
string | $name, |
|
|
string | $value, |
|
|
bool | $allow_duplicates = true ) |
Set a parameter.
- Parameters
-
string | $name | Parameter name |
string | $value | Parameter value |
bool | $allow_duplicates | True if duplicates are allowed |
◆ sign_request()
Sign the request.
- Parameters
-
OAuthSignatureMethod | $signature_method | Signature method |
OAuthConsumer | $consumer | Consumer |
OAuthToken | null | $token | Token |
◆ to_header()
string to_header |
( |
?string | $realm = null | ) |
|
Builds the Authorization: header.
- Parameters
-
- Returns
- string
- Exceptions
-
◆ to_postdata()
Builds the data one would send in a POST request.
- Returns
- string
◆ to_url()
Builds a url usable for a GET request.
- Returns
- string
◆ unset_parameter()
void unset_parameter |
( |
string | $name | ) |
|
Delete a parameter.
- Parameters
-
string | $name | Parameter name |