In Files

  • soap/netHttpClient.rb

Class/Module Index [+]

Quicksearch

SOAP::NetHttpClient

Attributes

connect_timeout[RW]
debug_dev[RW]
no_proxy[RW]
protocol_version[RW]
proxy[R]
receive_timeout[RW]
send_timeout[RW]
ssl_config[RW]

Public Class Methods

new(proxy = nil, agent = nil) click to toggle source
 
               # File 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
            

Public Instance Methods

get_content(url, header = {}) click to toggle source
 
               # File 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 = {}) click to toggle source
 
               # File 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
            
proxy=(proxy) click to toggle source
 
               # File soap/netHttpClient.rb, line 46
def proxy=(proxy)
  if proxy.nil?
    @proxy = nil
  else
    if proxy.is_a?(URI)
      @proxy = proxy
    else
      @proxy = URI.parse(proxy)
    end
    if @proxy.scheme == nil or @proxy.scheme.downcase != 'http' or
        @proxy.host == nil or @proxy.port == nil
      raise ArgumentError.new("unsupported proxy `#{proxy}'")
    end
  end
  reset_all
  @proxy
end
            
reset(url) click to toggle source
 
               # File soap/netHttpClient.rb, line 78
def reset(url)
  # no persistent connection.  ignored.
end
            
reset_all() click to toggle source
 
               # File soap/netHttpClient.rb, line 82
def reset_all
  # no persistent connection.  ignored.
end
            
set_basic_auth(uri, user_id, passwd) click to toggle source
 
               # File 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
            
test_loopback_response() click to toggle source
 
               # File soap/netHttpClient.rb, line 42
def test_loopback_response
  raise NotImplementedError.new("not supported for now")
end
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus