2Performant 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/two_performant/oauth.rb +10 -3
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/lib/two_performant/oauth.rb
CHANGED
@@ -9,6 +9,13 @@ class Hash
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
+
class Net::HTTPGenericRequest
|
13
|
+
def oauth_body_hash_required?
|
14
|
+
puts 'pac oac'
|
15
|
+
|
16
|
+
return false
|
17
|
+
end
|
18
|
+
end
|
12
19
|
|
13
20
|
class TwoPerformant
|
14
21
|
class OAuth
|
@@ -17,7 +24,7 @@ class TwoPerformant
|
|
17
24
|
def initialize(options, host)
|
18
25
|
consumer = ::OAuth::Consumer.new(options[:consumer_token], options[:consumer_secret], {:site => host})
|
19
26
|
@access_token = ::OAuth::AccessToken.new(consumer, options[:access_token], options[:access_secret])
|
20
|
-
@headers = { 'Accept' => 'application/json', 'Content-Type' => 'application/
|
27
|
+
@headers = { 'Accept' => 'application/json', 'Content-Type' => 'application/json' }
|
21
28
|
end
|
22
29
|
|
23
30
|
def get(path, params_hash)
|
@@ -27,12 +34,12 @@ class TwoPerformant
|
|
27
34
|
end
|
28
35
|
|
29
36
|
def post(path, params_hash)
|
30
|
-
response = access_token.post(path, params_hash
|
37
|
+
response = access_token.post(path, params_hash, @headers)
|
31
38
|
JSON.parse(response.body)
|
32
39
|
end
|
33
40
|
|
34
41
|
def put(path, params_hash)
|
35
|
-
response = access_token.put(path, params_hash
|
42
|
+
response = access_token.put(path, params_hash, @headers)
|
36
43
|
JSON.parse(response.body)
|
37
44
|
end
|
38
45
|
|