Class: SOAP::NetHttpClient
Defined Under Namespace
Classes: Response, SessionManager
Constant Summary collapse
- SSLEnabled =
begin require 'net/https' true rescue LoadError false end
Instance Attribute Summary collapse
-
#connect_timeout ⇒ Object
Returns the value of attribute connect_timeout.
-
#debug_dev ⇒ Object
Returns the value of attribute debug_dev.
-
#no_proxy ⇒ Object
Returns the value of attribute no_proxy.
-
#protocol_version ⇒ Object
ignored for now.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#receive_timeout ⇒ Object
Returns the value of attribute receive_timeout.
-
#send_timeout ⇒ Object
ignored for now.
-
#ssl_config ⇒ Object
ignored for now.
Instance Method Summary collapse
- #get_content(url, header = {}) ⇒ Object
-
#initialize(proxy = nil, agent = nil) ⇒ NetHttpClient
constructor
A new instance of NetHttpClient.
- #post(url, req_body, header = {}) ⇒ Object
- #reset(url) ⇒ Object
- #reset_all ⇒ Object
- #save_cookie_store(filename) ⇒ Object
- #set_basic_auth(uri, user_id, passwd) ⇒ Object
- #set_cookie_store(filename) ⇒ Object
- #test_loopback_response ⇒ Object
Constructor Details
#initialize(proxy = nil, agent = nil) ⇒ NetHttpClient
Returns a new instance of NetHttpClient.
33 34 35 36 37 38 39 40 |
# File 'lib/soap/netHttpClient.rb', line 33 def initialize(proxy = nil, agent = nil) @proxy = proxy ? URI.parse(proxy) : nil @agent = agent @debug_dev = nil @session_manager = SessionManager.new @no_proxy = @ssl_config = @protocol_version = nil @connect_timeout = @send_timeout = @receive_timeout = nil end |
Instance Attribute Details
#connect_timeout ⇒ Object
Returns the value of attribute connect_timeout
29 30 31 |
# File 'lib/soap/netHttpClient.rb', line 29 def connect_timeout @connect_timeout end |
#debug_dev ⇒ Object
Returns the value of attribute debug_dev
26 27 28 |
# File 'lib/soap/netHttpClient.rb', line 26 def debug_dev @debug_dev end |
#no_proxy ⇒ Object
Returns the value of attribute no_proxy
25 26 27 |
# File 'lib/soap/netHttpClient.rb', line 25 def no_proxy @no_proxy end |
#protocol_version ⇒ Object
ignored for now.
28 29 30 |
# File 'lib/soap/netHttpClient.rb', line 28 def protocol_version @protocol_version end |
#proxy ⇒ Object
Returns the value of attribute proxy
24 25 26 |
# File 'lib/soap/netHttpClient.rb', line 24 def proxy @proxy end |
#receive_timeout ⇒ Object
Returns the value of attribute receive_timeout
31 32 33 |
# File 'lib/soap/netHttpClient.rb', line 31 def receive_timeout @receive_timeout end |
#send_timeout ⇒ Object
ignored for now.
30 31 32 |
# File 'lib/soap/netHttpClient.rb', line 30 def send_timeout @send_timeout end |
#ssl_config ⇒ Object
ignored for now.
27 28 29 |
# File 'lib/soap/netHttpClient.rb', line 27 def ssl_config @ssl_config end |
Instance Method Details
#get_content(url, header = {}) ⇒ Object
98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/soap/netHttpClient.rb', line 98 def get_content(url, header = {}) unless url.is_a?(URI) url = URI.parse(url) end extra = header.dup extra['User-Agent'] = @agent if @agent res = start(url) { |http| http.get(url.request_uri, extra) } res.body end |
#post(url, req_body, header = {}) ⇒ Object
86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/soap/netHttpClient.rb', line 86 def post(url, req_body, header = {}) unless url.is_a?(URI) url = URI.parse(url) end extra = header.dup extra['User-Agent'] = @agent if @agent res = start(url) { |http| http.post(url.request_uri, req_body, extra) } Response.new(res) end |
#reset(url) ⇒ Object
78 79 80 |
# File 'lib/soap/netHttpClient.rb', line 78 def reset(url) # no persistent connection. ignored. end |
#reset_all ⇒ Object
82 83 84 |
# File 'lib/soap/netHttpClient.rb', line 82 def reset_all # no persistent connection. ignored. end |
#save_cookie_store(filename) ⇒ Object
74 75 76 |
# File 'lib/soap/netHttpClient.rb', line 74 def (filename) raise NotImplementedError.new end |
#set_basic_auth(uri, user_id, passwd) ⇒ Object
64 65 66 67 68 |
# File 'lib/soap/netHttpClient.rb', line 64 def set_basic_auth(uri, user_id, passwd) # net/http does not handle url. @basic_auth = [user_id, passwd] raise NotImplementedError.new("basic_auth is not supported under soap4r + net/http.") end |
#set_cookie_store(filename) ⇒ Object
70 71 72 |
# File 'lib/soap/netHttpClient.rb', line 70 def (filename) raise NotImplementedError.new end |
#test_loopback_response ⇒ Object
42 43 44 |
# File 'lib/soap/netHttpClient.rb', line 42 def test_loopback_response raise NotImplementedError.new("not supported for now") end |