Class OAuthClient
In: lib/oauthclient.rb
Parent: HTTPClient

OAuthClient provides OAuth related methods in addition to HTTPClient.

See sample/ dir how to use OAuthClient. There are sample clients for Twitter, FriendFeed and Google Buzz.

Methods

Attributes

oauth_config  [RW] 
HTTPClient::OAuth::Config:OAuth configurator.

Public Class methods

Creates a OAuthClient instance which provides OAuth related methods in addition to HTTPClient.

Method signature is as same as HTTPClient. See HTTPClient.new

Public Instance methods

Get access token.

uri:URI for request token.
request_token:a request token String. See get_access_token.
request_token_secret:a request secret String. See get_access_token.
verifier:a verifier tag String.

When the request succeeds and the server returns a pair of access token and secret, oauth_config.token and oauth_token.secret are updated with the access token. Then you can call OAuthClient#get, post, delete, etc. All requests are signed.

Parse response and returns a Hash.

Get request token.

uri:URI for request token.
callback:callback String. This can be nil for OAuth 1.0a
param:Additional query parameter Hash.

It returns a HTTP::Message instance as a response. When the request is made successfully, you can retrieve a pair of request token and secret like following;

  res = client.get_request_token(...)
  token = res.oauth_params['oauth_token']
  secret = res.oauth_params['oauth_token_secret']

[Validate]