Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

adding REST streaming demo to the service root

  • Loading branch information...
commit 243e66f01a5c5b00ef5f33900b1b4221f219f5fe 1 parent c8f09ec
@peterneubauer authored
View
2  server/src/docs/dev/rest-api/index.txt
@@ -9,6 +9,8 @@ include::introduction.txt[]
include::get-service-root.txt[]
+include::get-service-root-streaming.txt[]
+
[[rest-api-nodes]]
== Nodes ==
View
18 server/src/functionaltest/java/org/neo4j/server/rest/GetOnRootFunctionalTest.java
@@ -25,8 +25,11 @@
import java.util.Map;
+import javax.ws.rs.core.MediaType;
+
import org.junit.Test;
import org.neo4j.graphdb.Transaction;
+import org.neo4j.helpers.collection.MapUtil;
import org.neo4j.kernel.AbstractGraphDatabase;
import org.neo4j.kernel.Version;
import org.neo4j.kernel.impl.annotations.Documented;
@@ -95,4 +98,19 @@ public void assert200OkFromGet() throws Exception
assertEquals( 200, response.getStatus() );
response.close();
}
+
+ /**
+ * The whole REST API can be transmitted as JSON streams,
+ * resulting in better performance and lower memory overhead at the server side.
+ * To use it, adjust your accept headers on the request for every call.
+ */
+ @Documented
+ @Test
+ @Graph("I know you")
+ public void get_service_root_streaming() throws Exception
+ {
+ data.get();
+ String body = gen.get().expectedType( new MediaType("application","json",MapUtil.stringMap("stream","true") )).expectedStatus( 200 ).get( getDataUri() ).entity();
+ body.toString();
+ }
}
Please sign in to comment.
Something went wrong with that request. Please try again.