Ruby and HTTP

Posted on 2006-04-13
Last Modified: 2012-08-13

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....
Question by:petepalmer
    LVL 24

    Accepted Solution

    Hm I know that libcurl provides such facilities, so I'd argue the libcurl bindings will provide that facilites. You can get it from

    However I have not tested it.

    LVL 27

    Assisted Solution

    look here,
    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

    LVL 27

    Expert Comment

    Here is a sample of using cookies (just tell Ruby cookie store filename, then save if needed).

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
    The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now