# Help Using LibCurl

**URL:** <https://www.ruby-forum.com/t/help-using-libcurl/147717>\
**Category:** Ruby\
**Created:** [September 4, 2008, 5:00pm UTC](https://www.ruby-forum.com/t/help-using-libcurl/147717 "2008-09-04T17:00:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [September 4, 2008, 5:00pm UTC](https://www.ruby-forum.com/t/help-using-libcurl/147717/1 "2008-09-04T17:00:32Z")

</div>

HI,  
I’m new to ruby and have to use the libcurl library but my code don’t  
seem to work.

@curl = curl\_init()  
curl\_setopt(@curl, CURLOPT\_RETURNTRANSFER, 1)

curl\_setopt(@curl, CURLOPT\_URL, ‘url’);  
curl\_setopt(@curl, CURLOPT\_POST, 0)  
@result = curl\_exec(@curl)  
@headers = curl\_getinfo(@curl)

Thx

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [September 8, 2008, 6:04pm UTC](https://www.ruby-forum.com/t/help-using-libcurl/147717/2 "2008-09-08T18:04:28Z")

</div>

On Sep 4, 10:58 am, removed\_email\_address@domain.invalid wrote:

> @headers = curl\_getinfo(@curl)
> 
> Thx

Is there a reason why you can’t use open-uri?
