Skip to content

Commit

Permalink
Fix HTTP/1 request example.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed May 30, 2020
1 parent ce97a7d commit 81c6e62
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions examples/http1/request.rb
Expand Up @@ -19,13 +19,9 @@
stream = Async::IO::Stream.new(peer)
client = Protocol::HTTP1::Connection.new(stream)

def client.read_line
@stream.read_until(Protocol::HTTP1::Connection::CRLF) or raise EOFError
end

puts "Writing request..."
client.write_request("www.google.com", "GET", "/search?q=kittens", "HTTP/1.1", [["Accept", "*/*"]])
client.write_body(nil)
client.write_body("HTTP/1.1", nil)

puts "Reading response..."
response = client.read_response("GET")
Expand Down

0 comments on commit 81c6e62

Please sign in to comment.