httply 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1d37057e1f9283c47105297acf72d2df5830d4ca52d7122bff2c0f553f59b52d
4
- data.tar.gz: d9824a74d238b9e588ad55cfb4bf2c62df0a8de74d9b27595cd108bbf0c7e095
3
+ metadata.gz: 237e5bfe4fe3053d213f195adf7f4f543b7cffaba49e6c2257ad9c9fb6770919
4
+ data.tar.gz: 38d8d0212fb48a38b8db98cd6d0accda241196f48197cf38e080c74a8c12feeb
5
5
  SHA512:
6
- metadata.gz: 2e16a95b0bf80c052b067d3013c9f366c50b7b59b157ae4fe8ea776a6227baa8ad3a78f97fb8def082e7f99fe1effac453f85b2e8d5f2dd555ab62df60d64878
7
- data.tar.gz: 38f3bf90fe397db2a2e053017346b1e550c3b84dc023ccefa6f06a6fba9620cf383945f83d0880f347685d97b6b9f53ae65a8b74b581a4fd84faff02348a9be0
6
+ metadata.gz: c13e44559de7459204edefcada96815eb5102a96d3c026d87d3f1a8322857b3969cbf861feb466f4fab5cf6ce4ee224da90e5da5b153b9c4e7137513ce1f7ddc
7
+ data.tar.gz: fb8f9731652fd6dbc3650c9fb71bb4450d41c38c299462a71cd52107c410bc35adee3a83c95f45b95b6a1b192e3e0b5f50c164a0ab8a25a64020e50810c47846
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- httply (0.1.0)
4
+ httply (0.1.1)
5
5
  agents (>= 0.1.4)
6
6
  faraday (>= 0.15.4)
7
7
  faraday_middleware (>= 0.13.1)
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)
@@ -1,3 +1,3 @@
1
1
  module Httply
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httply
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Johnsson