httply 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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/httply/client.rb +4 -2
- data/lib/httply/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 237e5bfe4fe3053d213f195adf7f4f543b7cffaba49e6c2257ad9c9fb6770919
|
4
|
+
data.tar.gz: 38d8d0212fb48a38b8db98cd6d0accda241196f48197cf38e080c74a8c12feeb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c13e44559de7459204edefcada96815eb5102a96d3c026d87d3f1a8322857b3969cbf861feb466f4fab5cf6ce4ee224da90e5da5b153b9c4e7137513ce1f7ddc
|
7
|
+
data.tar.gz: fb8f9731652fd6dbc3650c9fb71bb4450d41c38c299462a71cd52107c410bc35adee3a83c95f45b95b6a1b192e3e0b5f50c164a0ab8a25a64020e50810c47846
|
data/Gemfile.lock
CHANGED
data/lib/httply/client.rb
CHANGED
@@ -45,7 +45,7 @@ module Httply
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def request(path, method: :get, parameters: {}, data: {}, headers: {}, options: {}, as: nil)
|
48
|
-
connection = setup(path, headers: headers, options: options, as: as)
|
48
|
+
connection = setup(path, method: method, headers: headers, options: options, as: as)
|
49
49
|
|
50
50
|
response = case method
|
51
51
|
when :get
|
@@ -66,7 +66,7 @@ module Httply
|
|
66
66
|
return response
|
67
67
|
end
|
68
68
|
|
69
|
-
def setup(path, headers: {}, options: {}, as: nil)
|
69
|
+
def setup(path, method: :get, headers: {}, options: {}, as: nil)
|
70
70
|
client_options = options.fetch(:client, {})
|
71
71
|
follow_redirects = options.fetch(:follow_redirects, false)
|
72
72
|
redirect_limit = options.fetch(:redirects_limit, 10)
|
@@ -82,6 +82,8 @@ module Httply
|
|
82
82
|
|
83
83
|
builder.headers = headers
|
84
84
|
|
85
|
+
builder.request :url_encoded if [:post, :put, :patch, :delete].include?(method)
|
86
|
+
|
85
87
|
builder.response :logger if self.configuration.verbose
|
86
88
|
|
87
89
|
builder.response :xml, content_type: /\bxml$/ if as.eql?(:xml)
|
data/lib/httply/version.rb
CHANGED