Class: Liltest::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/liltest/request.rb

Instance Method Summary collapse

Constructor Details

#initialize(method, endpoint, body, headers) ⇒ Request

Returns a new instance of Request.



5
6
7
8
9
10
11
12
13
# File 'lib/liltest/request.rb', line 5

def initialize(method, endpoint, body, headers)
  @response = Typhoeus::Request.new(
    endpoint,
    method:        method,
    body:          body,
    params:        nil,
    headers:       headers
  ).run
end

Instance Method Details

#bodyObject



15
16
17
# File 'lib/liltest/request.rb', line 15

def body
  @response.body
end