Class: Syntropy::HTTP::Client
- Inherits:
-
Object
- Object
- Syntropy::HTTP::Client
- Defined in:
- lib/syntropy/http/client.rb
Instance Method Summary collapse
- #get(url, **headers) ⇒ Object
-
#initialize(machine) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(machine) ⇒ Client
Returns a new instance of Client.
9 10 11 |
# File 'lib/syntropy/http/client.rb', line 9 def initialize(machine) @machine = machine end |
Instance Method Details
#get(url, **headers) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/syntropy/http/client.rb', line 13 def get(url, **headers, &) uri = URI.parse(url) headers = headers.merge( ':method' => 'GET', ':path' => uri.request_uri ) req(uri, **headers, &) end |