Class: Restspec::Endpoints::Network::HTTPartyNetworkAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/restspec/endpoints/network.rb

Overview

It uses httparty to make a request.

Instance Method Summary collapse

Instance Method Details

#request(request_object) ⇒ Object


53
54
55
56
57
58
59
60
61
62
# File 'lib/restspec/endpoints/network.rb', line 53

def request(request_object)
  response = HTTParty.send(
    request_object.method,
    request_object.url,
    headers: request_object.headers,
    body: request_object.raw_payload
  )

  [response.code, response.headers, response.body]
end