Defect #7850
closed
Possible broken JSON REST API
Added by Artem Konoplin over 13 years ago.
Updated over 4 years ago.
Resolution:
Cant reproduce
Description
When i try to create a project using XML all is gone right.
For ex.: XML post to /projects.xml:
<project name="test123" identifier="test123"/>
Answer:
RC: 201 Message: Created
but when i try to make same thing in JSON format - error is occurred.
Ex.: JSON post to /projects.json:
{"project": {"name": "test123", "identifier": "test123"}}
Answer:
RC: 500 Message: Internal Server Error
Files
You need to provide the error stack trace for your Redmine log.
No error with current trunk or 1.1-stable.
Check again on latest 1.1.2 version. Return code is changed to 422.
RC: 422 Message: null
In attached files development log both from xml (working) and json (non-working).
I have similar problems both with redmine-1.1.1 and redmine-1.1.2.
wget my.server.url/projects.xml
works and downloads list of projects correctly
wget my.server.url/projects.json
causes a HTTP/406 error
Let me specify this a little more: GETting projects.json causes a HTTP/406 error both with and without API access key. GETting issues.json works both with and without API access key. Either issues.xml or projects.xml work fine. users/current.json causes a HTTP/404 error. This is on a fresh upgrade of redmine-1.1.2 with local gems
actionmailer (2.3.8)
actionpack (2.3.8)
activerecord (2.3.8)
activeresource (2.3.8)
activesupport (2.3.8)
fastthread (1.0.7)
i18n (0.4.2)
mysql (2.8.1)
passenger (2.2.14)
rack (1.0.1)
rails (2.3.8)
rake (0.8.7)
running on Apache/2.2.9 (Debian) Phusion_Passenger/2.2.14 PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_ssl/2.2.9 OpenSSL/0.9.8g.
I've just re-checked with current 1.1-stable. GET requests /projects.json or /users/current.json work as expected.
Also works for me on a fresh install -- have still no idea what's wrong with the old updated install, though.
- Status changed from New to Closed
- Resolution set to Cant reproduce
Also available in: Atom
PDF