daazweb-api 0.0.9 → 0.0.12

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e81aad94ec6a28eb26982ed8a694bc4b814c83275b40d614f3a6ab5cac567a0c
4
- data.tar.gz: 975b2d5837bfd8d75334045f9f5e95301d845013e6586deb38af8c9d34598246
3
+ metadata.gz: f216d209bd28da89db48a3ba5f3c360d59304ed6e2fecea14baec986571dcfa3
4
+ data.tar.gz: 44b7ea42d3eb1270b1afb88e988dc737b8c19c5872fdf6c11c34972cf7e69f94
5
5
  SHA512:
6
- metadata.gz: 9b5a5b7699395f1cdc34d038d6e2c9500380cc92e5bd25caabc378c3fc2a51de469f8edd4d73da4f61f3a5681cffbdd203c1aba24d2405fdc466a30af36c6ed8
7
- data.tar.gz: a899bf1a4de244d25222380323c3d19e6a9b195b89870355648dfee9fbe38559bc28c4412c2c0f8e3d3e6db796032deac24a668b5ec3bd05371259910c4023ba
6
+ metadata.gz: f87ab37933f2f9a26ad6e036ff914f779fea888a01e45f187c35446ee574ae3bf0dac2d6727025155d9aadcd9ef3a77d6e6a467a852944645b3ee2f12de49bc6
7
+ data.tar.gz: f0e9aedc9d80815ff58406a3460322bc4f8f2a0c5d6f2c7950b7aedabe3f14e3fd8b04ed49bbb7a224402157c749f99b45b8a0a593d66187c23b51328481a376
@@ -93,11 +93,11 @@ module DaazwebApi
93
93
  if request
94
94
  request.params.merge!(params) if params
95
95
  request.headers = {}
96
- request.headers['Content-Type'] = 'application/json'
96
+ request.headers['Content-Type'] = 'application/x-www-form-urlencoded'
97
97
  request.headers['Authorization'] = "Bearer #{self.access_token}"
98
98
  request.headers['User-Agent'] = "DaazwebApi/#{DaazwebApi::VERSION} Ruby gem"
99
99
  request.headers.merge!(headers) if headers
100
- request.body = MultiJson.dump(body) if body
100
+ request.body = body.try(:to_query)
101
101
  request.options.timeout = self.timeout
102
102
  request.options.open_timeout = self.open_timeout
103
103
  end
@@ -139,7 +139,7 @@ module DaazwebApi
139
139
  end
140
140
 
141
141
  def api_url
142
- base_api_url + @request_builder.path
142
+ base_api_url + @request_builder.path + "/"
143
143
  end
144
144
 
145
145
  def base_api_url
@@ -46,14 +46,14 @@ module DaazwebApi
46
46
  @path_parts.join('/')
47
47
  end
48
48
 
49
- def create(params: nil, headers: nil, body: {}, suffix: 'create')
50
- APIRequest.new(builder: self).post(params: params, headers: headers, suffix: suffix, body: body)
49
+ def create(params: nil, headers: nil, body: {})
50
+ APIRequest.new(builder: self).post(params: params, headers: headers, body: body)
51
51
  ensure
52
52
  reset
53
53
  end
54
54
 
55
55
  def update(params: nil, headers: nil, body: {})
56
- APIRequest.new(builder: self).post(params: params, headers: headers, suffix: 'edit', body: body)
56
+ APIRequest.new(builder: self).post(params: params, headers: headers, body: body)
57
57
  ensure
58
58
  reset
59
59
  end
@@ -65,7 +65,7 @@ module DaazwebApi
65
65
  end
66
66
 
67
67
  def delete(params: nil, headers: nil, body: {})
68
- APIRequest.new(builder: self).post(params: params, headers: headers, body: {}, suffix: 'delete')
68
+ APIRequest.new(builder: self).post(params: params, headers: headers, body: {})
69
69
  ensure
70
70
  reset
71
71
  end
@@ -1,3 +1,3 @@
1
1
  module DaazwebApi
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daazweb-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Osetrov