Class: Unleash::Bootstrap::Provider::FromUrl

Inherits:
Base
  • Object
show all
Defined in:
lib/unleash/bootstrap/provider/from_url.rb

Class Method Summary collapse

Methods inherited from Base

#read

Class Method Details

.read(url, headers = nil) ⇒ Object

Parameters:

  • url (String)
  • headers (Hash, nil) (defaults to: nil)

    HTTP headers to use. If not set, the unleash client SDK ones will be used.



9
10
11
12
13
14
15
# File 'lib/unleash/bootstrap/provider/from_url.rb', line 9

def self.read(url, headers = nil)
  response = Unleash::Util::Http.get(URI.parse(url), nil, headers)

  return nil if response.code != '200'

  response.body
end