Class: Syntropy::HTTP::Client
- Inherits:
-
Object
- Object
- Syntropy::HTTP::Client
- Defined in:
- lib/syntropy/http/client.rb
Overview
HTTP Client class.
Instance Method Summary collapse
-
#get(url, **headers) ⇒ Array
Performs a GET request.
-
#initialize(machine) ⇒ Client
constructor
Initializes an HTTP client.
Constructor Details
#initialize(machine) ⇒ Client
Initializes an HTTP client.
11 12 13 |
# File 'lib/syntropy/http/client.rb', line 11 def initialize(machine) @machine = machine end |
Instance Method Details
#get(url, **headers) ⇒ Array
Performs a GET request.
20 21 22 23 24 25 26 27 |
# File 'lib/syntropy/http/client.rb', line 20 def get(url, **headers, &) uri = URI.parse(url) headers = headers.merge( ':method' => 'GET', ':path' => uri.request_uri ) req(uri, **headers, &) end |