class Restspec::Endpoints::Network::HTTPartyNetworkAdapter

It uses [httparty](github.com/jnunemaker/httparty) to make a request.

Public Instance Methods

request(request_object) click to toggle source

@param request_object [Restspec::Endpoints::Request] the request to make. @return Array of three values representing the status code, the response's headers and the response's body. The first one is a number and the last two are hashes.

# 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