Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 22 lines (17 sloc) 0.325 kb
d5613d7 * added samples for async interface. closes #157.
nahi authored
1 $:.unshift(File.join('..', 'lib'))
90db881 * renamed http-access2 -> httpclient (HTTPAccess2::Client -> HTTPClient...
nahi authored
2 require "httpclient"
d5613d7 * added samples for async interface. closes #157.
nahi authored
3
4 c = HTTPClient.new
5
6 piper, pipew = IO.pipe
7 conn = c.post_async("http://localhost:8080/stream", piper)
8
9 Thread.new do
10 res = conn.pop
11 while str = res.content.read(10)
12 p str
13 end
14 end
15
16 p "type here"
17 while line = STDIN.gets
18 pipew << line
19 end
20 pipew.close
21 sleep 5
Something went wrong with that request. Please try again.