lib/shodan/clients/base.rb
def request(req)
        Net::HTTP.start(_host, 443, https_options) do |http|
          response = http.request(req)

          if response.code.to_i != 200
            json = JSON.parse(response.body)
            raise Error, json["error"] if json.key?("error")

            raise Error, response.body
          end
          JSON.parse response.body
        end
      end
# The path to the REST API endpoint.
The path to the REST API endpoint.
The path to the REST API endpoint .
def request(req)
        Net::HTTP.start(_host, 443, https_options) do |http|
          response = http.request(req)
          if response.code.to_i != 200
            json = JSON.parse(response.body)
            raise Error, json["error"] if json.key?("error")
            raise Error, response.body
          end
          JSON.parse response.body
        end
      end
def request ( req ) Net :: HTTP . start ( _host , 443 , https_options ) do | http | response = http . request ( req ) if response . code . to_i != 200 json = JSON . parse ( response . body ) raise Error , json [ "error" ] if json . key? ( "error" ) raise Error , response . body end JSON . parse response . body end end
The path to the REST API endpoint.
The path to the REST API endpoint .
req