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.
-
#request_filter ⇒ Object
readonly
ignored for now.
-
#send_timeout ⇒ Object
ignored for now.
-
#ssl_config ⇒ Object
ignored for now.
-
#test_loopback_response ⇒ Object
readonly
Returns the value of attribute test_loopback_response.
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_auth(uri, user_id, passwd) ⇒ Object
- #set_basic_auth(uri, user_id, passwd) ⇒ Object
- #set_cookie_store(filename) ⇒ Object
Constructor Details
#initialize(proxy = nil, agent = nil) ⇒ NetHttpClient
Returns a new instance of NetHttpClient.
36 37 38 39 40 41 42 43 44 45 |
# File 'lib/soap/netHttpClient.rb', line 36 def initialize(proxy = nil, agent = nil) @proxy = proxy ? URI.parse(proxy) : nil @agent = agent @debug_dev = nil @test_loopback_response = [] @request_filter = Filter::FilterChain.new @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.
30 31 32 |
# File 'lib/soap/netHttpClient.rb', line 30 def connect_timeout @connect_timeout end |
#debug_dev ⇒ Object
Returns the value of attribute debug_dev.
27 28 29 |
# File 'lib/soap/netHttpClient.rb', line 27 def debug_dev @debug_dev end |
#no_proxy ⇒ Object
Returns the value of attribute no_proxy.
26 27 28 |
# File 'lib/soap/netHttpClient.rb', line 26 def no_proxy @no_proxy end |
#protocol_version ⇒ Object
ignored for now.
29 30 31 |
# File 'lib/soap/netHttpClient.rb', line 29 def protocol_version @protocol_version end |
#proxy ⇒ Object
Returns the value of attribute proxy.
25 26 27 |
# File 'lib/soap/netHttpClient.rb', line 25 def proxy @proxy end |
#receive_timeout ⇒ Object
Returns the value of attribute receive_timeout.
32 33 34 |
# File 'lib/soap/netHttpClient.rb', line 32 def receive_timeout @receive_timeout end |
#request_filter ⇒ Object (readonly)
ignored for now.
34 35 36 |
# File 'lib/soap/netHttpClient.rb', line 34 def request_filter @request_filter end |
#send_timeout ⇒ Object
ignored for now.
31 32 33 |
# File 'lib/soap/netHttpClient.rb', line 31 def send_timeout @send_timeout end |
#ssl_config ⇒ Object
ignored for now.
28 29 30 |
# File 'lib/soap/netHttpClient.rb', line 28 def ssl_config @ssl_config end |
#test_loopback_response ⇒ Object (readonly)
Returns the value of attribute test_loopback_response.
33 34 35 |
# File 'lib/soap/netHttpClient.rb', line 33 def test_loopback_response @test_loopback_response end |
Instance Method Details
#get_content(url, header = {}) ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/soap/netHttpClient.rb', line 95 def get_content(url, header = {}) if str = @test_loopback_response.shift return str end 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
91 92 93 |
# File 'lib/soap/netHttpClient.rb', line 91 def post(url, req_body, header = {}) post_redirect(url, req_body, header, 10) end |
#reset(url) ⇒ Object
83 84 85 |
# File 'lib/soap/netHttpClient.rb', line 83 def reset(url) # no persistent connection. ignored. end |
#reset_all ⇒ Object
87 88 89 |
# File 'lib/soap/netHttpClient.rb', line 87 def reset_all # no persistent connection. ignored. end |
#save_cookie_store(filename) ⇒ Object
79 80 81 |
# File 'lib/soap/netHttpClient.rb', line 79 def (filename) raise NotImplementedError.new end |
#set_auth(uri, user_id, passwd) ⇒ Object
65 66 67 |
# File 'lib/soap/netHttpClient.rb', line 65 def set_auth(uri, user_id, passwd) raise NotImplementedError.new("auth is not supported under soap4r + net/http.") end |
#set_basic_auth(uri, user_id, passwd) ⇒ Object
69 70 71 72 73 |
# File 'lib/soap/netHttpClient.rb', line 69 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
75 76 77 |
# File 'lib/soap/netHttpClient.rb', line 75 def (filename) raise NotImplementedError.new end |