Class: IBM::Cloud::SDKHTTP::HTTPConnection
- Inherits:
-
Object
- Object
- IBM::Cloud::SDKHTTP::HTTPConnection
- Includes:
- HTTParty
- Defined in:
- lib/ibm/cloud/sdk_http/connection.rb
Overview
Class to wrap the HTTP Provider implementation.
Instance Method Summary collapse
- #add_proxy(host, port, user, password) ⇒ Object
- #default_options ⇒ Object
-
#initialize(logger) ⇒ HTTPConnection
constructor
A new instance of HTTPConnection.
- #request(method, path, params) ⇒ Object
-
#verbose_logger=(verbosity) ⇒ Object
Set the logger type to curl which has more information.
Constructor Details
#initialize(logger) ⇒ HTTPConnection
Returns a new instance of HTTPConnection.
13 14 15 16 |
# File 'lib/ibm/cloud/sdk_http/connection.rb', line 13 def initialize(logger) @logger = logger self.class.logger(logger, :debug, :apache) end |
Instance Method Details
#add_proxy(host, port, user, password) ⇒ Object
27 28 29 |
# File 'lib/ibm/cloud/sdk_http/connection.rb', line 27 def add_proxy(host, port, user, password) self.class.http_proxy(host, port, user, password) end |
#default_options ⇒ Object
23 24 25 |
# File 'lib/ibm/cloud/sdk_http/connection.rb', line 23 def self.class. end |
#request(method, path, params) ⇒ Object
31 32 33 34 |
# File 'lib/ibm/cloud/sdk_http/connection.rb', line 31 def request(method, path, params) response = self.class.send(method.to_sym, path, params) SDKResponse.new(response) end |
#verbose_logger=(verbosity) ⇒ Object
Set the logger type to curl which has more information.
19 20 21 |
# File 'lib/ibm/cloud/sdk_http/connection.rb', line 19 def verbose_logger=(verbosity) [:log_format] = verbosity ? :curl : :apache end |