https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292012-10-16T11:05:56ZRedmineRedmine - Defect #12104: REST API POST new project: malformed? or auth failure? Debian Stable Redminehttps://www.redmine.org/issues/12104?journal_id=420532012-10-16T11:05:56ZWim Bertels
<ul><li><strong>% Done</strong> changed from <i>0</i> to <i>10</i></li></ul><p>The problem seems with the way ruby/redmine handles the request</p>
<p>A key authenticated GET request works (giving all the projects):</p>
<pre>
curl -k -H "Content-Type: application/xml" -X GET \
https://serverx/projects.xml?key=akey
</pre>
<p>But a key authenticated POST request doenst work:</p>
<pre>
curl -k -H "Content-Type: application/xml" -X POST --data "@project.xml" \
https://serverx/projects.xml?key=akey
</pre>
<p>Gives the error:</p>
<pre>
Processing ProjectsController#add to xml (for 127.0.1.1 at 2012-10-16 13:05:01) [POST]
Parameters: {"format"=>"xml", "action"=>"add", "project"=>{"name"=>"snr1234name", "description"=>"Alleen om te testen", "identifier"=>"snr1234id"}, "controller"=>"projects", "key"=>"akey"}
Filter chain halted as [:authorize_global] rendered_or_redirected.
Completed in 12ms (View: 0, DB: 3) | 401 Unauthorized [https://serverX/projects.xml?key=akey]
</pre>
<p>While a login/password POST request does work:</p>
<pre>
curl -k -H "Content-Type: application/xml" -X POST --data "@project.xml" \
-u loginY:passZ https://serverX/projects.xml
</pre>
<p>HTH</p>