Class: Syntropy::HTTP::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/syntropy/http/client.rb

Instance Method Summary collapse

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