hot-coffee-twitter-ruby 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/twitter/rest_api.rb +5 -5
- metadata +1 -1
data/lib/twitter/rest_api.rb
CHANGED
@@ -29,10 +29,10 @@ module Twitter
|
|
29
29
|
end
|
30
30
|
|
31
31
|
def get(path, params = {}, require_auth = true)
|
32
|
-
path
|
32
|
+
path += '.json'
|
33
33
|
|
34
34
|
params_str = Util.to_params_str(params)
|
35
|
-
path
|
35
|
+
path += "?#{params_str}" if params_str
|
36
36
|
|
37
37
|
req = Net::HTTP::Get.new(path, @header)
|
38
38
|
req.basic_auth @login, @password if require_auth
|
@@ -41,7 +41,7 @@ module Twitter
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def post(path, params = {}, require_auth = true)
|
44
|
-
path
|
44
|
+
path += '.json'
|
45
45
|
|
46
46
|
req = Net::HTTP::Post.new(path, @header)
|
47
47
|
req.body = Util.to_params_str(params)
|
@@ -51,10 +51,10 @@ module Twitter
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def delete(path, params = {}, require_auth = true)
|
54
|
-
path
|
54
|
+
path += '.json'
|
55
55
|
|
56
56
|
params_str = Util.to_params_str(params)
|
57
|
-
path
|
57
|
+
path += "?#{params_str}" if params_str
|
58
58
|
|
59
59
|
req = Net::HTTP::Post.new(path, @header)
|
60
60
|
req.basic_auth @login, @password if require_auth
|