A Place for my head

On Ruby, Rails, Concurrency and fiction

Posted in : Uncategorized | No comments
  • To use http basic authentication with open-uri:
    source = "http://secretsite.com"
    content = nil
    open(source,:http_basic_authentication=>["username" "password"]) do |s|
      content = s.read
    end
    

Leave a Reply