zyxt 0.2.0 → 0.2.1
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 +4 -4
- data/lib/request_client.rb +12 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 58786dd2a040a7bc920364eabc49f5810dc4dffaf2dc28fc3fa6d195c5713053
|
4
|
+
data.tar.gz: 32d7615d2b07bcb3251383ef8f13977400221ab3586ae4544c322e9fcbc00a89
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c495422a60c48c353c50029b4f46d7c37dc5857dd9c20d76e42603cd91cf312f8d6b8f99dbcf3ef9d78eef48f2d893d6bfa0b4287f3219ab9985486adb63f8a6
|
7
|
+
data.tar.gz: 3b368a160910b098e8d1f1cb0387ea5867327be49e19ac8eda8887ce871c9dd48731931c937e688556e381294fd28567a8e9b6c012b383eb261ad21f615f4d35
|
data/lib/request_client.rb
CHANGED
@@ -9,24 +9,32 @@ module RequestClient
|
|
9
9
|
|
10
10
|
desc "get URL", "execute GET request to URL"
|
11
11
|
def get(url)
|
12
|
-
|
12
|
+
response = Request::Http.send_request("get", url)
|
13
|
+
puts "Status Code: #{response.code}"
|
14
|
+
puts "Body: #{response.body}"
|
13
15
|
end
|
14
16
|
|
15
17
|
desc "post URL", "execute POST request to URL"
|
16
18
|
option :body, :type => :hash, :desc => "Body of the request"
|
17
19
|
def post(url)
|
18
|
-
|
20
|
+
response = Request::Http.send_request("post", url, options[:body])
|
21
|
+
puts "Status Code: #{response.code}"
|
22
|
+
puts "Body: #{response.body}"
|
19
23
|
end
|
20
24
|
|
21
25
|
desc "put URL", "execute PUT request to URL"
|
22
26
|
option :body, :type => :hash, :desc => "Body of the request"
|
23
27
|
def put(url)
|
24
|
-
|
28
|
+
response = Request::Http.send_request("put", url, options[:body])
|
29
|
+
puts "Status Code: #{response.code}"
|
30
|
+
puts "Body: #{response.body}"
|
25
31
|
end
|
26
32
|
|
27
33
|
desc "delete URL", "execute DELETE request to URL"
|
28
34
|
def delete(url)
|
29
|
-
|
35
|
+
response = Request::Http.send_request("delete", url)
|
36
|
+
puts "Status Code: #{response.code}"
|
37
|
+
puts "Body: #{response.body}"
|
30
38
|
end
|
31
39
|
end
|
32
40
|
end
|