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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/json_requester.rb +4 -2
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 467b682d40a325f12cc3d3978295045e12be336637097d3969ec56a3a328d0b9
4
- data.tar.gz: c8555a3b99428168c237e77f213be694601e24e0bbf02c0c794eed322dfa4d92
3
+ metadata.gz: 8e1df20023411b7a5567297f88b898a79e92732fea4b526cc49b8bc1632dc11f
4
+ data.tar.gz: 5061adce106e50c69bdad3b3867d520d9078151037e9abdbf12861ffba3efae1
5
5
  SHA512:
6
- metadata.gz: 2d301ffcaaacbd12ec3fa4ebb4d6a452efbee0ad153e2b8b46368c75cff203c5b7685b91ee9d242bf11195ce8b99448015e964881fe9d7cdadd9d30231c0be91
7
- data.tar.gz: b6bfb90a49e3a58dea0caf47e99533041108991a8dde478ca89c859c85dece7051c1da3281973dc66b5307c00142fc16f0dd827adae23d7f696981183a92fbf5
6
+ metadata.gz: f951b7f470bfeadce95892e96da335cfb821c435b4cf3697b488ed12a4fd53b5395538c260896168ee159e19caf011ba211452ce088f014fc3ebfffff7f072bd
7
+ data.tar.gz: 109a9ce7779e9a5a91d3debd12ab6199f68ef6a811d53c6aacd5f9938b9f373811047acd4404f289c9ddf969bf4b565f5acba212bacf6a29a74a0210f5afdd39
@@ -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.5
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-01-06 00:00:00.000000000 Z
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.0.3
56
+ rubygems_version: 3.2.32
57
57
  signing_key:
58
58
  specification_version: 4
59
59
  summary: Basic Wrapper of Faraday