Cool.io-http 0.3.1 released

cool.io-http

by Lin Jen-Shin (godfat)

DESCRIPTION:

Simpler HTTP(S) for cool.io

CHANGES:

cool.io-http 0.3.1 – 2012-02-18

  • Make sure Response#status is an integer
  • Fixed a few bugs
  • Return the response object in HttpFiber

INSTALLATION:

gem install cool.io-http

SYNOPSIS:

Asynchrony client:

require 'cool.io/http'

Coolio::Http.request(:url => 'https://google.com'){ |response|
  puts "Response: #{response.body}"
  puts
  puts " Headers: #{response.headers}"
  puts "  Status: #{response.status}"
}

Coolio::Loop.default.run

Fiber-aware synchrony client:

require 'cool.io/http'

Fiber.new{
  Coolio::HttpFiber.request(:url => 'https://google.com'){ |

response|
puts “Response: #{response.body}”
puts
puts " Headers: #{response.headers}"
puts " Status: #{response.status}"
}
puts “DONE”
}.resume

puts "GO"
Coolio::Loop.default.run

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs