watson-ruby icon indicating copy to clipboard operation
watson-ruby copied to clipboard

Not sure if to fail with no method or default to GET? [lib/watson/remote.rb]

Open nhmood opened this issue 11 years ago • 0 comments

filename : lib/watson/remote.rb line # : 64 tag : review md5 : 663b8e2b89d43c517ffed3360f37b4d7

        # [review] - Not sure if to fail with no method or default to GET?
        case opts[:method].upcase
        when "GET"
            _req = Net::HTTP::Get.new(_uri.request_uri)

        when "POST"
            _req = Net::HTTP::Post.new(_uri.request_uri)

        else
            debug_print "No method specified, cannot make HTTP request\n"
            return false
        end
            # Check for basic authentication key in hash
        if opts[:basic_auth].size == 2
            _req.basic_auth(opts[:basic_auth][0], opts[:basic_auth][1])
        end 

nhmood avatar Nov 21 '13 16:11 nhmood