Class: Bing::Request
Overview
Responsible for making requests to Bing. Uses persistent HTTP connections.
Constant Summary collapse
Class Method Summary collapse
-
.get(uri) ⇒ Object
Perform a get request and ensure that the response.code == 20d, otherwise raise a BadGateway.
Class Method Details
.get(uri) ⇒ Object
Perform a get request and ensure that the response.code == 20d, otherwise raise a BadGateway.
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/bing/request.rb', line 13 def self.get uri response = HTTP.request uri puts uri if ENV['DEBUG'] raise Bing::BadGateway.bad_response(response.code, uri) unless response.code =~ /20\d/ response end |