I have a url that points to JSON output, however this url requires a username and password through a standard apache authentication field. I tried to access this url from my rails controller as follows:
result = JSON.parse(open("http://user: pass@myurl.com /json").read)
However, it does not work. I have on top of my controller the following:
require 'open-uri' require 'json'
I just get the error message ArgumentError, userinfo not supported. [RFC3986] ArgumentError, userinfo not supported. [RFC3986]
Dave
source share