neo4j/community — Issue #199: REST API errors are still sometimes HTML when they should be JSON
Author: aseemk
Created: 2012-01-25 19:07:24+00:00
State: open

This was filed and fixed for Cypher in the past; see issue #13.

We're upgrading now from 1.4 to 1.5, and part of that of course is the indexing API change. We forgot about that, and had a helluva time debugging it, because here also now, the returned error wasn't JSON.

I don't know if this has been fixed since 1.5, but at least in 1.5, you can see this for yourself by:

1. Open up the web admin; go to the console tab and click on the HTTP tab.
2. Paste this in (old indexing syntax):

```
POST /db/data/index/node/nodes/foo/bar {"url": "/db/data/node/1"}
```

The response is a 405, which is fine, but it's HTML when it should be JSON:

```html

Error 405 Method Not Allowed

HTTP ERROR 405

Problem accessing /db/data/index/node/nodes/foo/bar. Reason:

Method Not Allowed

Powered by Jetty://

```