title: Parameters not found in cypher query executed via rest in javascript
body: <p>Good morning,
  I have a Neo4j Database with Maven Dependencies build via a Java programm. Now I want to create a Webinterface to access the data.
  When executing a cypher POST via jQuery.ajax I get a bad request error.
  In details:</p>
  
  <pre><code>var query2 = '{"query":"start n = node(*) where n.groupId! = {groupId} and n.artifactId! = {artifactId} return n.version","params":{"groupId":"junit","artifactId":"junit"}}';
  </code></pre>
  
  <p>When I send this via rest to the server I get a 400 Bad Request error:</p>
  
  <blockquote>
    <p>{
      "message" : "Expected a parameter named groupId",
      "exception" : "BadInputException",
      "stacktrace" : [ "org.neo4j.server.rest.repr.RepresentationExceptionHandlingIterable.exceptionOnHasNext(RepresentationExceptionHandlingIterable.java:51)", "org.neo4j.helpers.collection.ExceptionHandlingIterable$1.hasNext(ExceptionHandlingIterable.java:61)", "org.neo4j.helpers.collection.IteratorWrapper.hasNext(IteratorWrapper.java:42)", "org.neo4j.server.rest.repr.ListRepresentation.serialize(ListRepresentation.java:58)", "org.neo4j.server.rest.repr.Serializer.serialize(Serializer.java:75)", "org.neo4j.server.rest.repr.MappingSerializer.putList(MappingSerializer.java:61)", "org.neo4j.server.rest.repr.CypherResultRepresentation.serialize(CypherResultRepresentation.java:50)", "org.neo4j.server.rest.repr.MappingRepresentation.serialize(MappingRepresentation.java:42)", "org.neo4j.server.rest.repr.OutputFormat.format(OutputFormat.java:170)", "org.neo4j.server.rest.repr.OutputFormat.formatRepresentation(OutputFormat.java:120)", "org.neo4j.server.rest.repr.OutputFormat.response(OutputFormat.java:107)", "org.neo4j.server.rest.repr.OutputFormat.ok(OutputFormat.java:55)", "org.neo4j.server.rest.web.CypherService.cypher(CypherService.java:68)", "java.lang.reflect.Method.invoke(Unknown Source)" ]
    }</p>
  </blockquote>
  
  <p>I also tried to build the query via a JS object like so:</p>
  
  <pre><code>        var query = {};
      query["query"] = text;
      query["params"] = JSON.parse("{" + params + "}");
  </code></pre>
  
  <p>Where text is the query string and params the parameters with right syntax. ("param1":"value1", ...)</p>
  
  <p>Until now this seems like I mistyped something somewhere.
  Interestingly the whole thing works when omitting the parameters and writing a request with just a "query" property.</p>
  
  <p>Also </p>
  
  <pre><code>JSONObject jObject = new JSONObject();
          Map&lt;String, Object&gt; params = new HashMap&lt;String, Object&gt;();
          params.put("groupId", "junit");
          params.put("artifactId", "junit");
          String query = "start n = node(*) where n.groupId! = {groupId} and n.artifactId! = {artifactId} return n.version";
          jObject.put("query", query);
          jObject.put("params", params);
  </code></pre>
  
  <p>and then sending jObject.toString() to the database in Java works like a charm...
  Well, I have to say I'm at my wit's end with this.
  Hope you guys can help me :)</p>