Class: CoreLibrary::HttpClientConfiguration
- Inherits:
-
ClientConfiguration
- Object
- ClientConfiguration
- CoreLibrary::HttpClientConfiguration
- Defined in:
- lib/apimatic-core/http/configurations/http_client_configuration.rb
Overview
Configuration for an HttpClient.
Instance Attribute Summary collapse
-
#http_callback ⇒ Object
readonly
Returns the value of attribute http_callback.
-
#http_client ⇒ Object
readonly
Returns the value of attribute http_client.
-
#logging_configuration ⇒ Object
readonly
Returns the value of attribute logging_configuration.
Instance Method Summary collapse
-
#initialize(connection: nil, adapter: :net_http_persistent, timeout: 60, max_retries: 0, retry_interval: 1, backoff_factor: 2, retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods: %i[get put],, cache: false, verify: true, http_callback: nil, http_client: nil, logging_configuration: nil) ⇒ HttpClientConfiguration
constructor
Initializes a new instance of HttpClientConfiguration.
-
#set_http_client(http_client) ⇒ Object
Setter for http_client.
Constructor Details
#initialize(connection: nil, adapter: :net_http_persistent, timeout: 60, max_retries: 0, retry_interval: 1, backoff_factor: 2, retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods: %i[get put],, cache: false, verify: true, http_callback: nil, http_client: nil, logging_configuration: nil) ⇒ HttpClientConfiguration
Initializes a new instance of HttpClientConfiguration.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/apimatic-core/http/configurations/http_client_configuration.rb', line 19 def initialize( connection: nil, adapter: :net_http_persistent, timeout: 60, max_retries: 0, retry_interval: 1, backoff_factor: 2, retry_statuses: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524], retry_methods: %i[get put], cache: false, verify: true, http_callback: nil, http_client: nil, logging_configuration: nil ) @response_factory = HttpResponseFactory.new @connection = connection @adapter = adapter @retry_interval = retry_interval @http_callback = http_callback @timeout = timeout @max_retries = max_retries @backoff_factor = backoff_factor @retry_statuses = retry_statuses @retry_methods = retry_methods @verify = verify @cache = cache @http_client = http_client @logging_configuration = logging_configuration end |
Instance Attribute Details
#http_callback ⇒ Object (readonly)
Returns the value of attribute http_callback.
4 5 6 |
# File 'lib/apimatic-core/http/configurations/http_client_configuration.rb', line 4 def http_callback @http_callback end |
#http_client ⇒ Object (readonly)
Returns the value of attribute http_client.
4 5 6 |
# File 'lib/apimatic-core/http/configurations/http_client_configuration.rb', line 4 def http_client @http_client end |
#logging_configuration ⇒ Object (readonly)
Returns the value of attribute logging_configuration.
4 5 6 |
# File 'lib/apimatic-core/http/configurations/http_client_configuration.rb', line 4 def logging_configuration @logging_configuration end |
Instance Method Details
#set_http_client(http_client) ⇒ Object
Setter for http_client.
43 44 45 |
# File 'lib/apimatic-core/http/configurations/http_client_configuration.rb', line 43 def set_http_client(http_client) @http_client = http_client end |