socialHub_httpUtility 1.0.3 → 1.0.4
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/socialHub_httpUtility.rb +7 -1
- data/lib/socialHub_httpUtility/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fcadcfdbb27ff7f26bbca324df713ab8a2a401e
|
4
|
+
data.tar.gz: 070607d48d947d9277dac99dc7b8a4f18f784354
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb1a9c63bb0561fe8feed48fee297002b31a306c02d470dbff6d2118ed9b2460bf51ddbc6f6a663bec107116ded84a3aef141c3e63b9847b099e404d72505b70
|
7
|
+
data.tar.gz: 8c1780e96133dc51eb5b444727177cb1a600dfaa7ec1f6fde84195202b720c646ab405612bd6d3885869e9f8b2463bef202cd441778b9978567f64f7fdce7ff7
|
@@ -4,9 +4,12 @@ module SocialHubHttpUtility
|
|
4
4
|
|
5
5
|
def self.get_http_request(domain, path, params, headers, distination_service)
|
6
6
|
url = domain+path
|
7
|
+
http_end_index = url.index(':')
|
8
|
+
http_type = url[0 , http_end_index]
|
7
9
|
uri = URI.parse(url)
|
8
|
-
uri.query = URI.encode_www_form( params
|
10
|
+
uri.query = URI.encode_www_form( params)
|
9
11
|
http = Net::HTTP.new(uri.host, uri.port)
|
12
|
+
http.use_ssl = (http_type == 'https')
|
10
13
|
request = Net::HTTP::Get.new(uri.request_uri)
|
11
14
|
headers.each do |key,value|
|
12
15
|
request.add_field(key, value)
|
@@ -70,8 +73,11 @@ module SocialHubHttpUtility
|
|
70
73
|
|
71
74
|
def self.post_http_request(domain, path, params, headers, distination_service)
|
72
75
|
url = domain+path
|
76
|
+
http_end_index = url.index(':')
|
77
|
+
http_type = url[0 , http_end_index]
|
73
78
|
uri = URI.parse(url)
|
74
79
|
http = Net::HTTP.new(uri.host, uri.port)
|
80
|
+
http.use_ssl = (http_type == 'https')
|
75
81
|
post_data = URI.encode_www_form(params)
|
76
82
|
if(!headers.key?("request-id"))
|
77
83
|
headers["request-id"] = SecureRandom.uuid
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: socialHub_httpUtility
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- AbdAllah Elabasery
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|