• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

Ruby and HTTP

Hi,

I need to access a website from within a Ruby app. The problem is that the built in net/http and net/https libraries don't support cookies which is something I really need.

Does anyone know of an alternative way to do this? There are a couple of scripts around but they haven't been maintained for years....
0
petepalmer
Asked:
petepalmer
  • 2
2 Solutions
 
fridomCommented:
Hm I know that libcurl provides such facilities, so I'd argue the libcurl bindings will provide that facilites. You can get it from

http://rox-ruby.sourceforge.net/cms.php/curl

However I have not tested it.

Regards
Friedrich
0
 
NopiusCommented:
look here,  http://raa.ruby-lang.org/project/http-access2/
there are features supported:
    * methods like GET/HEAD/POST via HTTP/1.1.
    * asynchronous HTTP request
    * HTTPS(SSL)
    * by contrast with net/http in standard distribution;
          o you don't have to care HTTP/1.1 persistent connection (http-access2 cares instead of you).
          o MT-safe
          o streaming POST
          o Cookies

0
 
NopiusCommented:
Here is a sample of using cookies (just tell Ruby cookie store filename, then save if needed).
http://raa.ruby-lang.org/gonzui/markup/http-access2/sample/howto.rb
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now