json_requester 1.0.5 → 1.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/json_requester.rb +4 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e1df20023411b7a5567297f88b898a79e92732fea4b526cc49b8bc1632dc11f
|
4
|
+
data.tar.gz: 5061adce106e50c69bdad3b3867d520d9078151037e9abdbf12861ffba3efae1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f951b7f470bfeadce95892e96da335cfb821c435b4cf3697b488ed12a4fd53b5395538c260896168ee159e19caf011ba211452ce088f014fc3ebfffff7f072bd
|
7
|
+
data.tar.gz: 109a9ce7779e9a5a91d3debd12ab6199f68ef6a811d53c6aacd5f9938b9f373811047acd4404f289c9ddf969bf4b565f5acba212bacf6a29a74a0210f5afdd39
|
data/lib/json_requester.rb
CHANGED
@@ -4,12 +4,14 @@ require 'json'
|
|
4
4
|
class JsonRequester
|
5
5
|
attr_reader :host, :conn
|
6
6
|
|
7
|
-
def initialize(host, multipart: false)
|
7
|
+
def initialize(host, multipart: false, ssl_verify: true)
|
8
8
|
@host = host
|
9
9
|
@multipart = multipart
|
10
|
+
@ssl_verify = ssl_verify
|
10
11
|
end
|
11
12
|
|
12
13
|
def http_send(http_method, path, params={}, headers={})
|
14
|
+
puts "send #{http_method} reqeust to #{@host} with\npath: #{path}\nparams: #{params}\nheaders: #{headers}"
|
13
15
|
if http_method == :get
|
14
16
|
normal_send(http_method, path, params, headers)
|
15
17
|
else
|
@@ -68,7 +70,7 @@ class JsonRequester
|
|
68
70
|
private
|
69
71
|
|
70
72
|
def init_conn
|
71
|
-
Faraday.new(url: host) do |faraday|
|
73
|
+
Faraday.new(url: host, ssl: { verify: @ssl_verify }) do |faraday|
|
72
74
|
faraday.request :multipart if @multipart # multipart form POST request
|
73
75
|
faraday.request :url_encoded # form-encode POST params
|
74
76
|
faraday.response :logger # log requests to $stdout
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: json_requester
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- JiaRou Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
requirements: []
|
56
|
-
rubygems_version: 3.
|
56
|
+
rubygems_version: 3.2.32
|
57
57
|
signing_key:
|
58
58
|
specification_version: 4
|
59
59
|
summary: Basic Wrapper of Faraday
|