typhoeus 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/typhoeus.rb +1 -1
- data/lib/typhoeus/request.rb +23 -0
- metadata +1 -1
data/lib/typhoeus.rb
CHANGED
data/lib/typhoeus/request.rb
CHANGED
@@ -84,5 +84,28 @@ module Typhoeus
|
|
84
84
|
def cache_key
|
85
85
|
Digest::SHA1.hexdigest(url)
|
86
86
|
end
|
87
|
+
|
88
|
+
def self.run(url, params)
|
89
|
+
r = new(url, params)
|
90
|
+
Typhoeus::Hydra.hydra.queue r
|
91
|
+
Typhoeus::Hydra.hydra.run
|
92
|
+
r.response
|
93
|
+
end
|
94
|
+
|
95
|
+
def self.get(url, params)
|
96
|
+
run(url, params.merge(:method => :get))
|
97
|
+
end
|
98
|
+
|
99
|
+
def self.post(url, params)
|
100
|
+
run(url, params.merge(:method => :post))
|
101
|
+
end
|
102
|
+
|
103
|
+
def self.put(url, params)
|
104
|
+
run(url, params.merge(:method => :put))
|
105
|
+
end
|
106
|
+
|
107
|
+
def self.delete(url, params)
|
108
|
+
run(url, params.merge(:method => :delete))
|
109
|
+
end
|
87
110
|
end
|
88
111
|
end
|