Class: Pindo::HttpClient

Inherits:
Object
  • Object
show all
Defined in:
lib/pindo/client/httpclient.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#baseurlObject

Returns the value of attribute baseurl.



15
16
17
# File 'lib/pindo/client/httpclient.rb', line 15

def baseurl
  @baseurl
end

#request_configObject

Returns the value of attribute request_config.



16
17
18
# File 'lib/pindo/client/httpclient.rb', line 16

def request_config
  @request_config
end

#tokenObject

Returns the value of attribute token.



14
15
16
# File 'lib/pindo/client/httpclient.rb', line 14

def token
  @token
end

#use_local_wechat_urlObject

Returns the value of attribute use_local_wechat_url.



13
14
15
# File 'lib/pindo/client/httpclient.rb', line 13

def use_local_wechat_url
  @use_local_wechat_url
end

Class Method Details

.create_instanceObject



32
33
34
35
36
# File 'lib/pindo/client/httpclient.rb', line 32

def self.create_instance()
    
    con = Faraday.new 
    con
end

.create_instance_with_proxyObject



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/pindo/client/httpclient.rb', line 18

def self.create_instance_with_proxy()

    # puts body_params.to_json
    proxy_options = {
      uri: ENV['http_proxy'] || ENV['https_proxy'],
      user: ENV['HTTP_PROXY_USER'],
      password: ENV['HTTP_PROXY_PASSWORD']
    }

    con = Faraday.new 
    con.proxy = proxy_options.compact if proxy_options[:uri]
    con
end