E
e deleflie
Hi all,
I'm using rest-client (in a Shoooes app) to post a multi-part form to
my rails server. I've been struck down by a gotcha (which may not be a
gotcha for non-newbies).
What I want to do is post an image file within the form. Examples show
that the correct syntax is such:
params = {'myObject[name]' => "some name",
'myObject[details]' => "some extra
details and stuff here.",
:myObject[image] =>
File.new('/baa/baa/screen-capture-1.png')
}
response = RestClient.post
"http://me:[email protected]/myObject.xml", params
but :myObject[image] is not a valid symbol ... and that's how rails
creates the names of the fields in the forms ...
Any ideas?
Etienne
I'm using rest-client (in a Shoooes app) to post a multi-part form to
my rails server. I've been struck down by a gotcha (which may not be a
gotcha for non-newbies).
What I want to do is post an image file within the form. Examples show
that the correct syntax is such:
params = {'myObject[name]' => "some name",
'myObject[details]' => "some extra
details and stuff here.",
:myObject[image] =>
File.new('/baa/baa/screen-capture-1.png')
}
response = RestClient.post
"http://me:[email protected]/myObject.xml", params
but :myObject[image] is not a valid symbol ... and that's how rails
creates the names of the fields in the forms ...
Any ideas?
Etienne