parameters with put request


Karl Baum <karl.baum@...>
 

How would one make the following put request with rest-client.

curl "http://localhost:9997/index?mail_id=1&user_id=1&class=Order&url=1" -T tmp.eml

I would rather not have to manually encode the parameters onto the url myself.

thx

-karl


Archiloque <code@...>
 

RestClient.post 'http://localhost:9997/index', :mail_id => 1, user_id => 1, ... , :file => File.new("tmp.eml", 'rb')
should do the trick

more info on the project's README at https://github.com/archiloque/rest-client

A.

Le 3 déc. 2010 à 18:23, Karl Baum a écrit :

How would one make the following put request with rest-client.

curl "http://localhost:9997/index?mail_id=1&user_id=1&class=Order&url=1" -T tmp.eml

I would rather not have to manually encode the parameters onto the url myself.

thx

-karl



Karl Baum <karl.baum@...>
 

I think my example was a bit misleading as i was trying to demonstrate with curl. In my ruby program, the body or payload is already in memory. I have tried this and it seems to work:

RestClient.put("http://localhost:9997/index", :payload=>rfc822, :mail_id=>1, :user_id=>self.user_id, :class=>bucket_classification, :url=>email_file_path )

Thanks!

On Dec 3, 2010, at 1:27 PM, Archiloque wrote:

RestClient.post 'http://localhost:9997/index', :mail_id => 1, user_id => 1, ... , :file => File.new("tmp.eml", 'rb')
should do the trick

more info on the project's README at https://github.com/archiloque/rest-client

A.


Le 3 déc. 2010 à 18:23, Karl Baum a écrit :

How would one make the following put request with rest-client.

curl "http://localhost:9997/index?mail_id=1&user_id=1&class=Order&url=1" -T tmp.eml

I would rather not have to manually encode the parameters onto the url myself.

thx

-karl