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.
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/soap/netHttpClient.rb', line 37 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.
31 32 33 |
# File 'lib/soap/netHttpClient.rb', line 31 def connect_timeout @connect_timeout end |
#debug_dev ⇒ Object
Returns the value of attribute debug_dev.
28 29 30 |
# File 'lib/soap/netHttpClient.rb', line 28 def debug_dev @debug_dev end |
#no_proxy ⇒ Object
Returns the value of attribute no_proxy.
27 28 29 |
# File 'lib/soap/netHttpClient.rb', line 27 def no_proxy @no_proxy end |
#protocol_version ⇒ Object
ignored for now.
30 31 32 |
# File 'lib/soap/netHttpClient.rb', line 30 def protocol_version @protocol_version end |
#proxy ⇒ Object
Returns the value of attribute proxy.
26 27 28 |
# File 'lib/soap/netHttpClient.rb', line 26 def proxy @proxy end |
#receive_timeout ⇒ Object
Returns the value of attribute receive_timeout.
33 34 35 |
# File 'lib/soap/netHttpClient.rb', line 33 def receive_timeout @receive_timeout end |
#request_filter ⇒ Object (readonly)
ignored for now.
35 36 37 |
# File 'lib/soap/netHttpClient.rb', line 35 def request_filter @request_filter end |
#send_timeout ⇒ Object
ignored for now.
32 33 34 |
# File 'lib/soap/netHttpClient.rb', line 32 def send_timeout @send_timeout end |
#ssl_config ⇒ Object
ignored for now.
29 30 31 |
# File 'lib/soap/netHttpClient.rb', line 29 def ssl_config @ssl_config end |
#test_loopback_response ⇒ Object (readonly)
Returns the value of attribute test_loopback_response.
34 35 36 |
# File 'lib/soap/netHttpClient.rb', line 34 def test_loopback_response @test_loopback_response end |
Instance Method Details
#get_content(url, header = {}) ⇒ Object
96 97 98 99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/soap/netHttpClient.rb', line 96 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
92 93 94 |
# File 'lib/soap/netHttpClient.rb', line 92 def post(url, req_body, header = {}) post_redirect(url, req_body, header, 10) end |
#reset(url) ⇒ Object
84 85 86 |
# File 'lib/soap/netHttpClient.rb', line 84 def reset(url) # no persistent connection. ignored. end |
#reset_all ⇒ Object
88 89 90 |
# File 'lib/soap/netHttpClient.rb', line 88 def reset_all # no persistent connection. ignored. end |
#save_cookie_store(filename) ⇒ Object
80 81 82 |
# File 'lib/soap/netHttpClient.rb', line 80 def (filename) raise NotImplementedError.new end |
#set_auth(uri, user_id, passwd) ⇒ Object
66 67 68 |
# File 'lib/soap/netHttpClient.rb', line 66 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
70 71 72 73 74 |
# File 'lib/soap/netHttpClient.rb', line 70 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
76 77 78 |
# File 'lib/soap/netHttpClient.rb', line 76 def (filename) raise NotImplementedError.new end |