# Curl/Curb

**URL:** <https://www.ruby-forum.com/t/curl-curb/106760>\
**Category:** Rails\
**Created:** [June 13, 2007, 9:45pm UTC](https://www.ruby-forum.com/t/curl-curb/106760 "2007-06-13T21:45:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 13, 2007, 9:45pm UTC](https://www.ruby-forum.com/t/curl-curb/106760/1 "2007-06-13T21:45:42Z")

</div>

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](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!

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 13, 2007, 11:43pm UTC](https://www.ruby-forum.com/t/curl-curb/106760/2 "2007-06-13T23:43:34Z")

</div>

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](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.
