Forum: Ruby on Rails Curl/Curb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
650a2f40f54ea5477ab81f68304e713d?d=identicon&s=25 Ross (Guest)
on 2007-06-13 21:45
Hi,

I have some PHP that I need to emulate in Rails.

The PHP is:

curl_setopt($ch, CURLOPT_URL,"http://127.0.0.1/handler.php");
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, "USERNAME=name&PASSWORD=pass );

I've installed curllib and the curb rubygem, but being new to Rails I
have no idea how to 'use' curb within the rails app (require 'curb'
failed). Do I need to create a curb lib and drop it into the lib folder?

Some help would be greatly appreciated!
650a2f40f54ea5477ab81f68304e713d?d=identicon&s=25 Ross (Guest)
on 2007-06-13 23:43
Ross wrote:
> Hi,
>
> I have some PHP that I need to emulate in Rails.
>
> The PHP is:
>
> curl_setopt($ch, CURLOPT_URL,"http://127.0.0.1/handler.php");
>     curl_setopt($ch, CURLOPT_POST, 1);
>     curl_setopt($ch, CURLOPT_POSTFIELDS, "USERNAME=name&PASSWORD=pass );
>
> I've installed curllib and the curb rubygem, but being new to Rails I
> have no idea how to 'use' curb within the rails app (require 'curb'
> failed). Do I need to create a curb lib and drop it into the lib folder?
>
> Some help would be greatly appreciated!

Nevermind - accomplished it with net/http.
This topic is locked and can not be replied to.