webspicy 0.21.1 → 0.21.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/webspicy/version.rb +1 -1
- data/lib/webspicy/web/client/http_client.rb +9 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4ed553ffebc5521719b8ae05848942894671b9fc5599af596697bb774d3503d
|
4
|
+
data.tar.gz: 40c18bb7c4f4e6549a81d9cff8f671d5dc239bca5bf44a7f205c08cde901af09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f5ca666ad6d74f5a070671bf7ec97e9f40922322b24fdbfb20767afe08b2bbd31db7801b2c5d580d6e9a5adcbc44040a5431f23943941a9828c9cea04c40b4b
|
7
|
+
data.tar.gz: cbf46a595dc6365e65b38442097f617c5f845a7daea54c18aeac2a374dec46949061b5a534577a57ba68ea19bfe627abae2e6f2b9b0fa59f1ffa35ac5494316d
|
data/lib/webspicy/version.rb
CHANGED
@@ -55,8 +55,8 @@ module Webspicy
|
|
55
55
|
def options(url, params = {}, headers = nil, body = nil)
|
56
56
|
info_request("OPTIONS", url, params, headers, body)
|
57
57
|
|
58
|
-
|
59
|
-
http_opts = http_options
|
58
|
+
url = url + "?" + Rack::Utils.build_query(params) if !params.empty?
|
59
|
+
http_opts = http_options
|
60
60
|
@last_response = HTTP[headers || {}].options(url, http_opts)
|
61
61
|
|
62
62
|
debug_response(@last_response)
|
@@ -67,8 +67,8 @@ module Webspicy
|
|
67
67
|
def get(url, params = {}, headers = nil, body = nil)
|
68
68
|
info_request("GET", url, params, headers, body)
|
69
69
|
|
70
|
-
|
71
|
-
http_opts = http_options
|
70
|
+
url = url + "?" + Rack::Utils.build_query(params) if !params.empty?
|
71
|
+
http_opts = http_options
|
72
72
|
@last_response = HTTP[headers || {}].get(url, http_opts)
|
73
73
|
|
74
74
|
debug_response(@last_response)
|
@@ -111,6 +111,7 @@ module Webspicy
|
|
111
111
|
def patch(url, params = {}, headers = nil, body = nil)
|
112
112
|
info_request("PATCH", url, params, headers, body)
|
113
113
|
|
114
|
+
url = url + "?" + Rack::Utils.build_query(params) if body && !params.empty?
|
114
115
|
headers ||= {}
|
115
116
|
headers['Content-Type'] ||= 'application/json'
|
116
117
|
http_opts = http_options(body: params.to_json)
|
@@ -124,6 +125,7 @@ module Webspicy
|
|
124
125
|
def put(url, params = {}, headers = nil, body = nil)
|
125
126
|
info_request("PUT", url, params, headers, body)
|
126
127
|
|
128
|
+
url = url + "?" + Rack::Utils.build_query(params) if body && !params.empty?
|
127
129
|
headers ||= {}
|
128
130
|
headers['Content-Type'] ||= 'application/json'
|
129
131
|
http_opts = http_options(body: params.to_json)
|
@@ -137,6 +139,7 @@ module Webspicy
|
|
137
139
|
def post_form(url, params = {}, headers = nil, body = nil)
|
138
140
|
info_request("POST", url, params, headers, body)
|
139
141
|
|
142
|
+
url = url + "?" + Rack::Utils.build_query(params) if body && !params.empty?
|
140
143
|
http_opts = http_options(form: params)
|
141
144
|
@last_response = HTTP[headers || {}].post(url, http_opts)
|
142
145
|
|
@@ -148,6 +151,7 @@ module Webspicy
|
|
148
151
|
def delete(url, params = {}, headers = nil, body = nil)
|
149
152
|
info_request("DELETE", url, params, headers, body)
|
150
153
|
|
154
|
+
url = url + "?" + Rack::Utils.build_query(params) if body && !params.empty?
|
151
155
|
http_opts = http_options(body: params.to_json)
|
152
156
|
@last_response = HTTP[headers || {}].delete(url, http_opts)
|
153
157
|
|
@@ -156,7 +160,7 @@ module Webspicy
|
|
156
160
|
@last_response
|
157
161
|
end
|
158
162
|
|
159
|
-
def http_options(extra)
|
163
|
+
def http_options(extra = {})
|
160
164
|
if config.insecure
|
161
165
|
ctx = OpenSSL::SSL::SSLContext.new
|
162
166
|
ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webspicy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.21.
|
4
|
+
version: 0.21.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bernard Lambeau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-07-
|
11
|
+
date: 2022-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|