Module: Webpagetest::Connection
Overview
Configures and performs connection requests
Constant Summary collapse
- ENDPOINT =
'http://www.webpagetest.org/'
Instance Method Summary collapse
Instance Method Details
#get_connection(options = nil) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/webpagetest/connection.rb', line 7 def get_connection( = nil) = Hashie::Mash.new( { request: :url_encoded, response: :logger, adapter: Faraday.default_adapter, } ) if .nil? url = .url || ENDPOINT connection = Faraday.new(url: url) do |faraday| faraday.request .request faraday.response .response faraday.adapter .adapter end end |