1
我尝试了一个简单的密码休息请求。但是,我收到了400个错误的请求作为回应。请求输出似乎没问题。怎么了?Cypher请求通过Rest返回400错误请求,为什么?
public class HelloRest {
public static String SERVER_ROOT_URI = "http://localhost:7474/db/data/";
public static void main(String[] args) {
Client client = Client.create();
client.addFilter(new LoggingFilter(System.out));
WebResource cypher = client.resource(SERVER_ROOT_URI + "cypher");
String request = "{\"query\":\"MATCH (n) RETURN n\"}";
ClientResponse cypherResponse = cypher.post(ClientResponse.class, request);
System.out.println(cypherResponse);
}
}
我以为我试过之前没有成功,但现在它的工作。谢谢。 ClientResponse cypherResponse = cypher.accept(MediaType.APPLICATION_JSON).post(ClientResponse.class,request);' –