rest 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,20 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rest (1.1.0)
4
+ rest (1.2.0)
5
+ net-http-persistent
5
6
  rest-client (>= 0.3.0)
6
7
 
7
8
  GEM
8
9
  remote: https://rubygems.org/
9
10
  specs:
10
11
  ffi (1.0.11)
11
- mime-types (1.18)
12
+ mime-types (1.19)
12
13
  net-http-persistent (2.7)
13
14
  quicky (0.0.1)
14
15
  rake (0.9.2.2)
15
16
  rest-client (1.6.7)
16
17
  mime-types (>= 1.16)
17
- test-unit (2.5.0)
18
+ test-unit (2.5.1)
18
19
  typhoeus (0.4.2)
19
20
  ffi (~> 1.0)
20
21
  mime-types (~> 1.18)
@@ -24,7 +25,6 @@ PLATFORMS
24
25
  ruby
25
26
 
26
27
  DEPENDENCIES
27
- net-http-persistent
28
28
  quicky
29
29
  rake
30
30
  rest!
@@ -1,3 +1,3 @@
1
1
  module Rest
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -35,7 +35,10 @@ module Rest
35
35
  end
36
36
 
37
37
  def default_headers
38
- {}
38
+ {
39
+ "Accept-Encoding" => "gzip, deflate",
40
+ #"Accept" => "*/*; q=0.5, application/xml"
41
+ }
39
42
  end
40
43
 
41
44
  def add_headers(post, req_hash, default_headers)
@@ -56,7 +59,7 @@ module Rest
56
59
  uri = URI(url)
57
60
  #p uri
58
61
  #p uri.path
59
- post = Net::HTTP::Get.new fix_path(uri.path)
62
+ post = Net::HTTP::Get.new fix_path(uri.request_uri)
60
63
  add_headers(post, req_hash, default_headers)
61
64
  response = http.request uri, post
62
65
  @client.logger.debug response.class.name
@@ -22,6 +22,18 @@ class TestTests < TestBase
22
22
 
23
23
  end
24
24
 
25
+ def test_gets
26
+ @token = "abctoken"
27
+ headers = {
28
+ 'Content-Type' => 'application/json',
29
+ 'Authorization' => "OAuth #{@token}",
30
+ 'User-Agent' => "someagent"
31
+ }
32
+ body = {"foo" => "bar"}
33
+ response = @rest.get("http://requestb.in/16q6zwq1?param1=x")
34
+
35
+ end
36
+
25
37
  def test_post_with_headers
26
38
 
27
39
  @token = "abctoken"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: