I have a site which is protected using the http basic authentication.
I wish to code a ruby snippet which allows me to pass the http basic authentication and read the contents of the web page.
I have used a way in java to send the key and other details set in HTTP header and thus read the contents of the web page. But couldn't able to find the same in ruby.
edit:
The code I use is here:
def express
http_basic_authenticate_with :name => "dhh", :password => "secret"
end
which gives me the error:
undefined method `http_basic_authenticate_with' for #<ServiceController:0x7f9bd73e5448>
Thanks in advance.