Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Fwd: Generating http post in Ruby
Ashkey
3/12/2007 2:41:00 PM
Hi, I'm in need to send a file throught an http post and examine the
response within a Rails project.
Net::HTTP is powerful but way too hard to use, I'm in need of
something slick and quick to use and manage.
Actually I've found Curb, which works like a charm (
http://rubyforge.org/pro...
) but it has a big problem: it
depends on external libraries (curlib) and doesn't work at all on win
(which is the platform used by most of our team).
What would really be a great tool is an high level libraries which
relies on Net::HTTP o similar, which allows me to achieve my results
with really compact statements.
Curb is really smart at this:
c = Curl::Easy.new post_url
c.multipart_form_post = true
c.http_post(
Curl::PostField.content('some_var_name', some_var_value),
Curl::PostField.file('file_name', incomming_file.path)
)
puts c.body_str if c.response_code == 200
Is there any other similar library that can work on multiple platforms
--
Ashkey < Jules Piccotti
1 Answer
Ara.T.Howard
3/12/2007 2:46:00 PM
0
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Fwd: Generating http post in Ruby
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password