From: Nick da G Date: 2008-10-09T04:05:11+09:00 Subject: Re: How to use ruby, csv and webservice? Need a direction. Thanks, Shajith. That's uber cool. I couldn't get your example working so I had to redo it slightly. But THANK YOU for the pointer - that was exactly what I needed. For anyone else looking here is what I ended up doing require 'open-uri' url = 'http://localhost:3000/report_details/csv_export/2' csv = open(url, :http_basic_authentication=>['username','password']).read File.open('exports.csv','w') { |f| f.write(csv)} On a side note I was wondering how would pipe output of of open(url) straight into a file? As I understand File.open(){} - takes each line of csv and writes it to file. Am I wrong? -- Posted via http://www.ruby-forum.com/.