class Aws::Plugins::StubResponses::Handler

def signal_http(stub, http_resp, async_mode = false)

Parameters:
  • async_mode (Boolean) --
  • http_resp (Seahorse::Client::Http::Response | Seahorse::Client::Http::AsyncResponse) --
  • stub (Seahorse::Client::Http::Response) --
def signal_http(stub, http_resp, async_mode = false)
  if async_mode
    h2_headers = stub.headers.to_h.inject([]) do |arr, (k, v)|
      arr << [k, v]
    end
    h2_headers << [":status", stub.status_code]
    http_resp.signal_headers(h2_headers)
  else
    http_resp.signal_headers(stub.status_code, stub.headers.to_h)
  end
  while chunk = stub.body.read(1024 * 1024)
    http_resp.signal_data(chunk)
  end
  stub.body.rewind
  http_resp.signal_done
end