| Class | FaradayMiddleware::OAuth |
| In: |
lib/faraday_middleware/request/oauth.rb
|
| Parent: | Faraday::Middleware |
Public: Uses the simple_oauth library to sign requests according the OAuth protocol.
The options for this middleware are forwarded to SimpleOAuth::Header: :consumer_key, :consumer_secret, :token, :token_secret. All these parameters are optional.
The signature is added to the "Authorization" HTTP request header. If the value for this header already exists, it is not overriden.
If no Content-Type header is specified, this middleware assumes that request body parameters should be included while signing the request. Otherwise, it only includes them if the Content-Type is "application/x-www-form-urlencoded", as per OAuth 1.0.
For better performance while signing requests, this middleware should be positioned before UrlEncoded middleware on the stack, but after any other body-encoding middleware (such as EncodeJson).
| AUTH_HEADER | = | 'Authorization'.freeze |
| CONTENT_TYPE | = | 'Content-Type'.freeze |
| TYPE_URLENCODED | = | 'application/x-www-form-urlencoded'.freeze |