Class: KineticSdk::Utils::KineticHttp

Inherits:
Object
  • Object
show all
Includes:
KineticHttpUtils
Defined in:
lib/kinetic_sdk/utils/kinetic-http.rb

Overview

The KineticHttp class provides functionality to make generic HTTP requests.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from KineticHttpUtils

#default_headers, default_headers, #default_jwt_headers, default_jwt_headers, #delete, #encode, #gateway_retry_delay, #gateway_retry_limit, #get, #head, #header_accept_json, header_accept_json, #header_basic_auth, header_basic_auth, header_bearer_auth, #header_bearer_auth, #header_content_json, header_content_json, header_user_agent, #header_user_agent, #max_redirects, #mimetype, #patch, #post, #post_multipart, #put, #redirect_url, #stream_download_to_file

Constructor Details

#initialize(username = nil, password = nil, http_options = {}) ⇒ KineticHttp

Constructor

Parameters:

  • username (String) (defaults to: nil)

    username for Basic Authentication

  • password (String) (defaults to: nil)

    password for Basic Authentication

  • http_options (Hash) (defaults to: {})

    hash of http options

Options Hash (http_options):

  • :log_level (String) — default: off

    log_level

  • :max_redirects (Fixnum) — default: 5

    max number of times to redirect

  • :gateway_retry_limit (Fixnum) — default: -1

    max number of times to retry a bad gateway

  • :gateway_retry_delay (Float) — default: 1.0

    number of seconds to delay before retrying a bad gateway

  • :ssl_ca_file (String) — default: /etc/ca.crt certificate

    location of the ca certificate

  • :ssl_verify_mode (String) — default: none

    use peer to enable verification



802
803
804
805
806
# File 'lib/kinetic_sdk/utils/kinetic-http.rb', line 802

def initialize(username=nil, password=nil, http_options={})
  @username = username
  @password = password
  @options = http_options
end

Instance Attribute Details

#passwordObject (readonly)

The password used in the Basic Authentication header



789
790
791
# File 'lib/kinetic_sdk/utils/kinetic-http.rb', line 789

def password
  @password
end

#usernameObject (readonly)

The username used in the Basic Authentication header



787
788
789
# File 'lib/kinetic_sdk/utils/kinetic-http.rb', line 787

def username
  @username
end