Class: Net::HTTPGenericRequest

### Home Classes Methods

### In Files

- lib/oauth/client/net_http.rb

### Parent

Object

### Methods

- #oauth!
- #signature_base_string

### Included Modules

- OAuth::Helper

### Files

- LICENSE
- README.rdoc
- TODO

### Class/Module Index

Quicksearch

- OAuth
- OAuth::AccessToken
- OAuth::CLI
- OAuth::Client
- OAuth::Client::Helper
- OAuth::Consumer
- OAuth::ConsumerToken
- OAuth::Error
- OAuth::Helper
- OAuth::OAuthTestHelper
- OAuth::Problem
- OAuth::RequestProxy
- OAuth::RequestProxy::ActionControllerRequest
- OAuth::RequestProxy::Base
- OAuth::RequestProxy::Curl
- OAuth::RequestProxy::Curl::Easy
- OAuth::RequestProxy::EventMachine
- OAuth::RequestProxy::EventMachine::HttpRequest
- OAuth::RequestProxy::JabberRequest
- OAuth::RequestProxy::MockRequest
- OAuth::RequestProxy::Net
- OAuth::RequestProxy::Net::HTTP
- OAuth::RequestProxy::Net::HTTP::HTTPRequest
- OAuth::RequestProxy::RackRequest
- OAuth::RequestProxy::Typhoeus
- OAuth::RequestProxy::Typhoeus::Request
- OAuth::RequestProxy::UnknownRequestType
- OAuth::RequestToken
- OAuth::Server
- OAuth::ServerToken
- OAuth::Signature
- OAuth::Signature::Base
- OAuth::Signature::HMAC
- OAuth::Signature::HMAC::Base
- OAuth::Signature::HMAC::MD5
- OAuth::Signature::HMAC::RMD160
- OAuth::Signature::HMAC::SHA1
- OAuth::Signature::HMAC::SHA2
- OAuth::Signature::MD5
- OAuth::Signature::PLAINTEXT
- OAuth::Signature::RSA
- OAuth::Signature::RSA::SHA1
- OAuth::Signature::SHA1
- OAuth::Signature::UnknownSignatureMethod
- OAuth::Token
- OAuth::Unauthorized
- ActionController
- ActionController::Base
- ActionController::TestRequest
- Digest
- Digest::HMAC
- EventMachine
- EventMachine::HttpClient
- Net
- Net::HTTPGenericRequest
- Object
- String

No matching classes.

# Net::HTTPGenericRequest

### Attributes

oauth_helper[R]

### Public Instance Methods

oauth!(http, consumer = nil, token = nil, options = {}) click to toggle source

Add the OAuth information to an HTTP request. Depending on the `options[:scheme]` setting this may add a header, additional query string parameters, or additional POST body parameters. The default scheme is `header`, in which the OAuth parameters as put into the `Authorization` header.

- http - Configured Net::HTTP instance

- consumer - OAuth::Consumer instance

- token - OAuth::Token instance

- options - Request-specific options (e.g. `request_uri`, `consumer`, `token`, `scheme`, `signature_method`, `nonce`, `timestamp`)

This method also modifies the `User-Agent` header to add the OAuth gem version.

See Also: OAuth core spec version 1.0, section 5.4.1,

    {OAuth Request Body Hash 1.0 Draft 4}[http://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/drafts/4/spec.html]

    # File lib/oauth/client/net_http.rb, line 25
    def oauth!(http, consumer = nil, token = nil, options = {})
      helper_options = oauth_helper_options(http, consumer, token, options)
      @oauth_helper = OAuth::Client::Helper.new(self, helper_options)
      @oauth_helper.amend_user_agent_header(self)
      @oauth_helper.hash_body if oauth_body_hash_required?
      self.send("set_oauth_#{helper_options[:scheme]}")
    end

signature_base_string(http, consumer = nil, token = nil, options = {}) click to toggle source

Create a string suitable for signing for an HTTP request. This process involves parameter normalization as specified in the OAuth specification. The exact normalization also depends on the `options[:scheme]` being used so this must match what will be used for the request itself. The default scheme is `header`, in which the OAuth parameters as put into the `Authorization` header.

- http - Configured Net::HTTP instance

- consumer - OAuth::Consumer instance

- token - OAuth::Token instance

- options - Request-specific options (e.g. `request_uri`, `consumer`, `token`, `scheme`, `signature_method`, `nonce`, `timestamp`)

See Also: OAuth core spec version 1.0, section 9.1.1,

    {OAuth Request Body Hash 1.0 Draft 4}[http://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/drafts/4/spec.html]

    # File lib/oauth/client/net_http.rb, line 47
    def signature_base_string(http, consumer = nil, token = nil, options = {})
      helper_options = oauth_helper_options(http, consumer, token, options)
      oauth_helper = OAuth::Client::Helper.new(self, helper_options)
      oauth_helper.hash_body if oauth_body_hash_required?
      oauth_helper.signature_base_string
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.