Interacting with a REST interface from another application

Generating XML is very easy in RESTful Rails, consuming it is left to the developer. Any RESTful URL link that ends with xml will fetch the XML document. In your controller you can do something like:

require "net/http"

begin   my_site = Net::HTTP.new("www.mycoolsite.com", 8080)   response, data = my_site.get("products.xml", nil) rescue => err   puts "Error: #{err}" end

puts "Received #{data.split.size} lines, #{data.size} bytes" # Parse your XML document here...

Remember that security is not handled here. One way to implement the other http functions is to look at the Rails 1.2 RC1 source code. You will learn a lot from it. HTH.