Forum: Ruby on Rails Net::HTTP.get_response with local files "file://..."

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
781b8c8006a09543237ef172bf3275bf?d=identicon&s=25 Steffen Binas (stebi)
on 2007-01-01 16:03
(Received via mailing list)

In my application I fetch a webpage with Net::HTTP.get_response(url).
For creating a unit test I don't want to be depended on an internet
connection. So I tried to give an url like that:
"file:///c:/mydir/mypage.html" (this url works in webbrower). But it
seems that this is not the right protocol for Net::HTTP. Is there any
possibility to use such "file:///"-urls with Net::HTTP or do I have to
check for the protocol and open the file directly?

This topic is locked and can not be replied to.