Methods

__construct()

__construct($consumerKey, $consumerSecret = ''

Parameters

$consumerKey

$consumerSecret

Call API with a GET request. Returns either false on failure or an HttpResponse object.

get($accessTokenKey, $accessTokenSecret, $url, array $getData = array()

Parameters

$accessTokenKey

$accessTokenSecret

$url

$getData

getAccessToken()

getAccessToken($accessTokenURL, $requestToken, $httpMethod = 'POST', array $parameters = array()

Parameters

$accessTokenURL

$requestToken

$httpMethod

$parameters

Returns an HttpResponse object for the previous request, or null, if there was no request.

getFullResponse() 

getRequestToken()

getRequestToken(mixed $requestTokenURL, mixed $callback = 'oob', mixed $httpMethod = 'POST', array $parameters = array()

Parameters

$requestTokenURL

$callback

An absolute URL to which the server will redirect the resource owner back when the Resource Owner

             Authorization step is completed. If the client is unable to receive callbacks or a callback URL 
             has been established via other means, the parameter value MUST be set to oob (case sensitive), to 
             indicate an out-of-band configuration. Section 2.1 from http://tools.ietf.org/html/rfc5849

$httpMethod

'POST' or 'GET'

$parameters

Call API with a POST request. Returns either false on failure or an HttpResponse object.

post($accessTokenKey, $accessTokenSecret, $url, array $postData = array()

Parameters

$accessTokenKey

$accessTokenSecret

$url

$postData

Call API with a POST request, the content type set to multipart/form-data.

postMultipartFormData($accessTokenKey, $accessTokenSecret, $url, array $paths, array $postData = array()
This is, for example, necessary for Twitter's update_with_media API method (https://dev.twitter.com/docs/api/1/post/statuses/update_with_media) $paths a key-value array, example: array('media[]' => '/home/dho/avatar.png') Returns either false on failure or an HttpResponse object.

Parameters

$accessTokenKey

$accessTokenSecret

$url

$paths

$postData

createOAuthToken()

createOAuthToken(array $response) 

Parameters

$response

createConsumer()

createConsumer() 

createRequest()

createRequest($httpMethod, $url, $token, array $parameters) 

Parameters

$httpMethod

$url

$token

$parameters

doGet()

doGet($url) 

Parameters

$url

doPost()

doPost($url, $data) 

Parameters

$url

$data

doPostMultipartFormData()

doPostMultipartFormData($url, $authorization, $paths, $data) 

Parameters

$url

$authorization

$paths

$data

getToken()

getToken($request) 

Parameters

$request

 Properties

 

$consumerKey

$consumerKey 

Default

null
 

$consumerSecret

$consumerSecret 

Default

null
 

$fullResponse

$fullResponse 

Default

null
 

$url

$url 

Default

null