Sha256: 42708cbe31544622c19c1475bfc52e0202dadf436aecb93f5bce3f7ae5fbef1b
Contents?: true
Size: 722 Bytes
Versions: 1
Compression:
Stored size: 722 Bytes
Contents
require "rquest/version" require 'net/http/post/multipart' require 'mimemagic' require 'benchmark' require "rquest/requestor" module Rquest class << self def new( settings ) Requestor.new( settings ) end def client_class_for_verb( verb, use_multipart=false ) v = verb.to_s.capitalize unless use_multipart Object.const_get("Net::HTTP::#{v}") else Object.const_get("Net::HTTP::#{v}::Multipart") end end end end class Hash def to_q_param_string self.inject([]){|r,(k,v)| r.push( "#{k}=#{v}" )}.join("&") end end class String def to_q_param_hash self.split("&").inject({}) do |hash, key_value| key, value = key_value.split("=") hash[key.to_sym] = value hash end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rquest-0.1.0 | lib/rquest.rb |