class Seahorse::Client::Http::Request

def body

Returns:
  • (IO) -
def body
  @body
end

def body=(io)

Parameters:
  • io (#read, #size, #rewind) --
def body=(io)
  @body =case io
    when nil then StringIO.new('')
    when String then StringIO.new(io)
    else io
  end
end

def body_contents

Returns:
  • (String) -
def body_contents
  body.rewind
  contents = body.read
  body.rewind
  contents
end

def endpoint

Returns:
  • (URI::HTTP, URI::HTTPS, nil) -
def endpoint
  @endpoint
end

def endpoint=(endpoint)

Parameters:
  • endpoint (String, URI::HTTP, URI::HTTPS, nil) --
def endpoint=(endpoint)
  endpoint = URI.parse(endpoint) if endpoint.is_a?(String)
  if endpoint.nil? or URI::HTTP === endpoint or URI::HTTPS === endpoint
    @endpoint = endpoint
  else
    msg = "invalid endpoint, expected URI::HTTP, URI::HTTPS, or nil, "
    msg << "got #{endpoint.inspect}"
    raise ArgumentError, msg
  end
end

def initialize(options = {})

Options Hash: (**options)
  • :body (Body) --
  • :headers (Headers) --
  • :http_method (String) --
  • :endpoint (URI::HTTP, URI::HTTPS) --
def initialize(options = {})
  self.endpoint = options[:endpoint]
  self.http_method = options[:http_method] || 'GET'
  self.headers = Headers.new(options[:headers] || {})
  self.body = options[:body]
end