Sha256: 7fa5e1b7123a019f49e92eb588e141c4884efaf9e01042dcbb16d04df6875f10
Contents?: true
Size: 781 Bytes
Versions: 30
Compression:
Stored size: 781 Bytes
Contents
# frozen_string_literal: true module Concourse module Http class Request attr_reader :url, :headers, :body def initialize(url, headers = {}, body = nil) @url = url @headers = headers @body = body end def ==(other) other.class == self.class && other.state == state end def eql?(other) self == other end def hash state.hash end protected def state [@url, @headers, @body] end end def assert_successful(request, response) raise api_error(request, response) unless response.status < 400 end private def api_error(request, response) Errors::ApiError.new(request: request, response: response) end end end
Version data entries
30 entries across 30 versions & 1 rubygems