A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://rubydoc.info/github/piotrmurach/github/master/Github/Middleware below:

Middleware – Documentation for piotrmurach/github (master) – RubyDoc.info

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/github_api/middleware.rb', line 13

def self.default(options = {})
  api = options[:api]
  proc do |builder|
    builder.use Github::Request::Jsonize
    builder.use Faraday::Request::Multipart
    builder.use Faraday::Request::UrlEncoded
    builder.use Github::Request::OAuth2, api.oauth_token if api.oauth_token?
    builder.use Github::Request::BasicAuth, api.authentication if api.basic_authed?

    builder.use Github::Response::FollowRedirects if api.follow_redirects
    builder.use Faraday::Response::Logger if ENV['DEBUG']
    unless options[:raw]
      builder.use Github::Response::Mashify
      builder.use Github::Response::Jsonize
      builder.use Github::Response::AtomParser
    end
    if api.stack
      api.stack.call(builder)
    end
    builder.use Github::Response::RaiseError
    builder.adapter options[:adapter]
  end
end

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4