gpd-request 0.2.6 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/gpd-request.rb +14 -2
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a6420a7d41bdcbd2413c51b3c60536d4eb40474
|
4
|
+
data.tar.gz: c8fba7dba67253dfc789c30106101c34ac930b77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e9cd2be28ae7164106d05e61070ff165bbd9241c376814504ce17e7eeebb0bc933b21723d6d635e912891f4f0d2bf987b242a6c23aabc3ab74cede3bd1ba535
|
7
|
+
data.tar.gz: 5d227fc31ea08303b7aa0367ea6db9783aa10ecd96f1e35a807c20feb31bc41479b295f648ed6d603fbc6fc38fdfbafc18e9d57d546659626ddba6204594ed43
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/gpd-request.rb
CHANGED
@@ -25,16 +25,28 @@ class GPDRequest
|
|
25
25
|
response
|
26
26
|
end
|
27
27
|
|
28
|
-
def get(uri)
|
28
|
+
def get(uri, params={})
|
29
29
|
|
30
30
|
if uri =~ /^http:/ then
|
31
|
-
|
31
|
+
|
32
|
+
request(uri) do |url|
|
33
|
+
|
34
|
+
if params.any? then
|
35
|
+
|
36
|
+
encoded_params = URI.encode_www_form(params)
|
37
|
+
Net::HTTP::Get.new [url.path, encoded_params].join('?'), @headers
|
38
|
+
|
39
|
+
else
|
40
|
+
Net::HTTP::Get.new url.path, @headers
|
41
|
+
end
|
42
|
+
end
|
32
43
|
elsif uri =~ /^https:/
|
33
44
|
Net::HTTP.get_response(URI.parse(uri))
|
34
45
|
end
|
35
46
|
end
|
36
47
|
|
37
48
|
def post(uri, form_data={})
|
49
|
+
|
38
50
|
request(uri) do |url|
|
39
51
|
req = Net::HTTP::Post.new(url.path, @headers)
|
40
52
|
req.set_form_data form_data unless form_data.empty?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gpd-request
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
5kgV31ryhm+mzvSnIN8PPLwwIM5uEYTrHytfjeeXQkpmsteTsitHqtzKFEKTQ69m
|
32
32
|
ZZmiIrzZdraCEg==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
35
35
|
dependencies: []
|
36
36
|
description:
|
37
37
|
email: james@r0bertson.co.uk
|
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
version: '0'
|
61
61
|
requirements: []
|
62
62
|
rubyforge_project:
|
63
|
-
rubygems_version: 2.4.
|
63
|
+
rubygems_version: 2.4.8
|
64
64
|
signing_key:
|
65
65
|
specification_version: 4
|
66
66
|
summary: GPD-Request is a convenient Net::HTTP wrapper
|
metadata.gz.sig
CHANGED
Binary file
|