# Passing parameters to a URL through curl in the application

**URL:** <https://www.ruby-forum.com/t/passing-parameters-to-a-url-through-curl-in-the-application/186070>\
**Category:** Rails\
**Created:** [March 31, 2010, 8:01am UTC](https://www.ruby-forum.com/t/passing-parameters-to-a-url-through-curl-in-the-application/186070 "2010-03-31T08:01:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@ashwin](https://www.ruby-forum.com/u/ashwin)\
**Post date:** [March 31, 2010, 8:01am UTC](https://www.ruby-forum.com/t/passing-parameters-to-a-url-through-curl-in-the-application/186070/1 "2010-03-31T08:01:19Z")

</div>

Hello all,

```
      I need few suggestions on how to pass the parameters to a URL

```

through curl. Currently I can do that using system() and %x[] through  
which I could give the curl command. But since these two executes the  
curl as a shell command I don’t want to use these to do that. For  
example I’m using it in this way in the controller code.

system(“curl -I -H &parameter=‘#{}’ [http://x.x.x.x/yyy/zzz.ext](http://x.x.x.x/yyy/zzz.ext)”)  
or  
%x[curl -I -H &parameter=‘#{}’ [http://x.x.x.x/yyy/zzz.ext](http://x.x.x.x/yyy/zzz.ext) ]

Is there any plug-ins or gems in rails which I can use to send the  
parameters using the curl and not executed as a shell command? If any  
please suggest. Now I’m using system() or %x[] which I want to evaluate  
because it executes the content in that as a shell command.

Thanks in advance and Regards.

---

<div class="post-metadata">

**Author:** ![ashwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@ashwin](https://www.ruby-forum.com/u/ashwin)\
**Post date:** [March 31, 2010, 8:54am UTC](https://www.ruby-forum.com/t/passing-parameters-to-a-url-through-curl-in-the-application/186070/2 "2010-03-31T08:54:49Z")

</div>

Search for ruby + libcurl for other suggestions, but patron might do  
what you want.

> **[GitHub - toland/patron: Ruby HTTP client based on libcurl](https://github.com/toland/patron)**
>
> Ruby HTTP client based on libcurl. Contribute to toland/patron development by creating an account on GitHub.

[http://www.rubyinside.com/patron-a-simpler-ruby-http-client-2067.html](http://www.rubyinside.com/patron-a-simpler-ruby-http-client-2067.html)

---

<div class="post-metadata">

**Author:** ![ashwin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/f08c70/32.png) [@ashwin](https://www.ruby-forum.com/u/ashwin)\
**Post date:** [March 31, 2010, 9:51am UTC](https://www.ruby-forum.com/t/passing-parameters-to-a-url-through-curl-in-the-application/186070/3 "2010-03-31T09:51:18Z")

</div>

G\_ F\_ wrote:

> Search for ruby + libcurl for other suggestions, but patron might do  
> what you want.
> 
> [GitHub - toland/patron: Ruby HTTP client based on libcurl](http://github.com/toland/patron)  
> [Patron: A Simpler Ruby HTTP Client for Ruby](http://www.rubyinside.com/patron-a-simpler-ruby-http-client-2067.html)

Thanks for your valuable suggestion, I will try it out.
