Top "Open-uri" questions

OpenURI is a Ruby module included in the standard library, which provides an easy-to-use wrapper for net/http, net/https and net/ftp.

In Ruby/Rails, how can I encode/escape special characters in URLs?

How do I encode or 'escape' the URL before I use OpenURI to open(url)? We're using OpenURI to open …

ruby urlencode open-uri
Retrieve contents of URL as string

For tedious reasons to do with Hpricot, I need to write a function that is passed a URL, and returns …

ruby open-uri
Is there a workaround to open URLs containing underscores in Ruby?

I'm using open-uri to open URLs. resp = open("http://sub_domain.domain.com") If it contains underscore I get an …

ruby open-uri
Ruby's open-uri and cookies

I would like to store the cookies from one open-uri call and pass them to the next one. I can't …

ruby cookies open-uri
Nokogiri, open-uri, and Unicode Characters

I'm using Nokogiri and open-uri to grab the contents of the title tag on a webpage, but am having trouble …

ruby unicode screen-scraping nokogiri open-uri
Ruby open-uri redirect forbidden

I have this simple html parser(for learning purposes) that I have been working on.: require 'open-uri' puts "Enter URL …

ruby open-uri
Rails - How to send an image from a controller

in my rails app, I need to pass back a image. I have a 1x1.gif tracking pixel in my …

ruby-on-rails ruby-on-rails-3 open-uri
Ruby Open-URI library aborted in 404 HTTP error code

I use OpenURI library. object = open("http://example.com") If http://example.com server code response is equals to 200 my …

ruby open-uri net-http
How to specify "http request header" in OpenURI

I am trying to call a URL using Ruby's OpenURI gem, however it needs me to pass certain values inside …

ruby open-uri
404 error with open-uri in a rake task... what's causing it?

I have a rake task that fetches JSON data from an API, parses it, and saves it to the database: …

ruby-on-rails ruby-on-rails-3 debugging rake open-uri