simple_uri 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/simple_uri/version.rb +1 -1
- data/lib/simple_uri.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a07c2e31c26acd24004059f3cb5116fdc74fe6e
|
4
|
+
data.tar.gz: 2908dd5fbf76ecf1c2fc9b391e28d166b2889ea5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 423305348bad1077ada24476475ae531a8b23a10d080f0518aeb26193a237c9a9ae0cc98f960545d2ed82d9ac22ab81db21bd4db451b8dfbbb30ad8671818bb4
|
7
|
+
data.tar.gz: 3b0b60d72fe1f0925b59cc3a13bf69138a72dbd9891363e65cc22f44c76ed3683ba2a57159c31ce40fb732831e8f237da683cbbdb3370cd4e8e73636ee47e46d
|
data/lib/simple_uri/version.rb
CHANGED
data/lib/simple_uri.rb
CHANGED
@@ -30,7 +30,8 @@ module SimpleUri
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def send_request(url=nil, method=:get, options={ params: nil, req_body: nil, req_headers: nil, user: nil, password: nil, debug: @@debug_mode, cookies: false })
|
33
|
-
|
33
|
+
get_params = options[:req_body].present? ? '?'+prepare_req_body(options[:req_body]).to_s : ''
|
34
|
+
options[:params] = method==:post ? nil : get_params
|
34
35
|
req, http = connect(url, method, { params: options[:params], user: options[:user], password: options[:password], debug: options[:debug] })
|
35
36
|
req.body = prepare_req_body(options[:req_body]) if method == :post
|
36
37
|
options[:req_headers].each { |k, v| req[k] = v } if options[:req_headers]
|