Date
1 - 7 of 7
Welcome to rest.client list.
Emiliano Heyns <Emiliano.Heyns@...>
I'm trying to upload a file to the crowdin translation site. The following curl call does the job:
curl -F "files[Redmine Backlogs.yml]=@..." http://api.crowdin.net/api/project/redmine_backlogs/update-file?key=blablabla
I'm using the following with rest_client, but I'm getting a "bad request" error: r = RestClient.post("http://api.crowdin.net/api/project/redmine_backlogs/update-file",
:key => 'blablabla', :files => {:"Redmine Backlogs.yml" => File.new('en.yml')} ) what is the correct way to send files[] type params?
|
|
Archiloque <code@...>
Hi,
toggle quoted messageShow quoted text
RestClient doesn't detect files in arrays (I'll fix it), could you try adding :multipart => true to the params ? A.
Le 15 août 2011 à 00:50, Emiliano Heyns a écrit : I'm trying to upload a file to the crowdin translation site. The following curl call does the job:
|
|
Emiliano Heyns <Emiliano.Heyns@...>
Same thing, "Bad Request".
toggle quoted messageShow quoted text
On Mon, Aug 15, 2011 at 09:53, Archiloque <code@...> wrote:
|
|
Archiloque <code@...>
Hi, no idea: when trying locally the log seems ok, could you try to check with their support to see if they see anything, or perhaps anybody else on the list has an idea ? A.
Le 15 août 2011 à 17:34, Emiliano Heyns a écrit : Same thing, "Bad Request".
|
|
Emiliano Heyns <Emiliano.Heyns@...>
I'll go check. To be sure, the code below ought to do the trick?
toggle quoted messageShow quoted text
project = 'redmine-backlogs'
r = RestClient.post("#{root}/update-file", :key => key, :json => 'json', :files => {:"Redmine Backlogs.yml" => File.new('/home/hnse/redmine/redmine_backlogs/config/locales/en.yml')},
:params => {:multipart => true} ) Thanks, Emile
On Mon, Aug 15, 2011 at 19:37, Archiloque <code@...> wrote:
|
|
Archiloque <code@...>
Sorry I was unclear, just add multipart as a parameter in the request:
toggle quoted messageShow quoted text
project = 'redmine-backlogs' r = RestClient.post("#{root}/update-file", :key => key, :json => 'json', :files => {:"Redmine Backlogs.yml" => File.new('/home/hnse/redmine/redmine_backlogs/config/locales/en.yml')}, :multipart => true # that's it ) or else you can pull the latest version of the code from the repo on the "next" branch, I've improved the file detection this afternoon A.
Le 15 août 2011 à 19:52, Emiliano Heyns a écrit : I'll go check. To be sure, the code below ought to do the trick?
|
|
Emiliano Heyns <Emiliano.Heyns@...>
OK, same problem, I've contacted their support. Thanks!
toggle quoted messageShow quoted text
On Mon, Aug 15, 2011 at 21:18, Archiloque <code@...> wrote:
|
|