Created
April 8, 2014 10:58
-
-
Save wasabhi/10109717 to your computer and use it in GitHub Desktop.
faraday initializer with timeout options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
connection = Faraday.new(request_host) do |faraday| | |
faraday.request :url_encoded | |
faraday.options[:timeout] = TIMEOUT | |
faraday.options[:open_timeout] = OPEN_TIMEOUT | |
faraday.response :logger if ENV['DEBUG'] | |
faraday.adapter Faraday.default_adapter | |
faraday.use FaradayMiddleware::ParseJson, :content_type => /\bjson$/ | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment