README.rdoc in igrigorik-em-http-request-0.1.7 vs README.rdoc in igrigorik-em-http-request-0.1.8
- old
+ new
@@ -4,10 +4,13 @@
- Simple interface for single & parallel requests via deferred callbacks
- Automatic gzip & deflate decoding
- Basic-Auth support
- Custom timeouts
+Screencast / Demo of using EM-HTTP-Request:
+ - http://everburning.com/news/eventmachine-screencast-em-http-request/
+
== Simple client example
EventMachine.run {
http = EventMachine::HttpRequest.new('http://127.0.0.1/').get :query => {'keyname' => 'value'}, :timeout => 10
@@ -59,11 +62,10 @@
# ...
}
== Streaming body processing
EventMachine.run {
- body = ''
- on_body = lambda { |chunk| body += chunk }
- http = EventMachine::HttpRequest.new('http://www.website.com/').get :on_response => on_body
+ http = EventMachine::HttpRequest.new('http://www.website.com/').get
+ http.stream { |chunk| print chunk }
# ...
}