Class | HTTPClient::Connection |
In: |
lib/httpclient/connection.rb
|
Parent: | Object |
Represents a HTTP response to an asynchronous request. Async methods of HTTPClient such as get_async, post_async, etc. returns an instance of Connection.
connection = clnt.post_async(url, body) print 'posting.' while true break if connection.finished? print '.' sleep 1 end puts '.' res = connection.pop p res.status
connection = clnt.get_async('http://dev.ctor.org/') io = connection.pop.content while str = io.read(40) p str end
async_thread | [RW] |
Retrieves a HTTP::Message instance of HTTP response. Do not invoke this method twice for now. The second invocation will be blocked.