client-api 0.3.8 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/client-api/base.rb +6 -0
- data/lib/client-api/request.rb +11 -0
- data/lib/client-api/version.rb +1 -1
- 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: 7226fe17e3d771738d7d0c3a658ca186ff49736fd195228e266816a0e0959761
|
4
|
+
data.tar.gz: c25f29df1e2b395404de270e5648ff2d532591e41afdd3ca7b1beefac9ddca0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77861a5f4db0702bf9e98f76d1d4217da6909f5b66dd590fbd1e880300a3ebe2fa8e186d76edad21123d7152bc563dcab8cfed5f7a326c9f5b5db0b6dac4137e
|
7
|
+
data.tar.gz: 39f64ca08d0b643a9ead2ed2bf1727406c811e821891a2b65e7af598e3736c6f3402bf558ab4722f110448f42198dd3b27be83ac9db07bc41d51b415f413ed5b
|
data/lib/client-api/base.rb
CHANGED
@@ -43,6 +43,12 @@ module ClientApi
|
|
43
43
|
self.output_json_body if json_output
|
44
44
|
end
|
45
45
|
|
46
|
+
def delete_with_body(url, body = nil, headers = nil)
|
47
|
+
@output = delete_with_body_request(url_generator(url), :body => body, :headers => headers)
|
48
|
+
self.post_logger if $logger
|
49
|
+
self.output_json_body if json_output
|
50
|
+
end
|
51
|
+
|
46
52
|
def put(url, body, headers = nil)
|
47
53
|
@output = put_request(url_generator(url), :body => body, :headers => headers)
|
48
54
|
self.post_logger if $logger
|
data/lib/client-api/request.rb
CHANGED
@@ -55,6 +55,17 @@ module ClientApi
|
|
55
55
|
@http.delete(uri(url).path, initheader = header(options))
|
56
56
|
end
|
57
57
|
|
58
|
+
def delete_with_body_request(url, options = {})
|
59
|
+
body = options[:body] || {}
|
60
|
+
connect(url)
|
61
|
+
pre_logger(:log_url => uri(url), :log_header => header(options), :log_body => body, :log_method => 'GET') if $logger
|
62
|
+
|
63
|
+
request = Net::HTTP::Delete.new(uri(url))
|
64
|
+
request.body = body.to_json
|
65
|
+
header(options).each { |key,value| request.add_field(key,value)}
|
66
|
+
@http.request(request)
|
67
|
+
end
|
68
|
+
|
58
69
|
def put_request(url, options = {})
|
59
70
|
body = options[:body] || {}
|
60
71
|
connect(url)
|
data/lib/client-api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: client-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Prashanth Sams
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|