Sha256: fe4919a8d7878ecdf5e870406df3e0a57c2111396842f36bd9a640223227aad5
Contents?: true
Size: 525 Bytes
Versions: 24
Compression:
Stored size: 525 Bytes
Contents
#!/usr/bin/env ruby require 'async' require 'async/http/endpoint' require 'async/http/client' Async do endpoint = Async::HTTP::Endpoint.parse("https://localhost:9292") client = Async::HTTP::Client.new(endpoint, Async::HTTP::Protocol::HTTP2::WithPush) response = client.get("/index.html") puts response.status puts response.read puts while promise = response.promises.dequeue promise.wait puts "** Promise: #{promise.request.path} **" puts promise.read puts end ensure client.close end puts "Done"
Version data entries
24 entries across 24 versions & 1 rubygems