[[rest-api-streaming]]
== Streaming ==

The whole REST API can be transmitted as JSON streams, resulting in
better performance and lower memory overhead on the server side. To use
it, adjust the request headers for every call, see the example below for
details.

CAUTION: This feature is new, and you should make yourself comfortable
with the streamed response style versus the non-streamed API where
results are delivered in a single large response. Expect future releases
to have streaming enabled by default since it is a far more efficient
mechanism for both client and server.


.Final Graph
["dot", "Final-Graph-streaming.svg", "neoviz", ""]
----
  N32 [
    label = "{Node\[32\]|name = \'you\'\l}"
  ]
  N33 [
    label = "{Node\[33\]|name = \'I\'\l}"
  ]
  N33 -> N32 [
    color = "#2e3436"
    fontcolor = "#2e3436"
    label = "know\n"
  ]
----

_Example request_

* *+GET+*  +http://localhost:7474/db/data/+
* *+Accept:+* +application/json+
* *+X-Stream:+* +true+

_Example response_

* *+200:+* +OK+
* *+Content-Type:+* +application/json; stream=true+
[source,javascript]
----
{
  "extensions" : {
  },
  "node" : "http://localhost:7474/db/data/node",
  "reference_node" : "http://localhost:7474/db/data/node/33",
  "node_index" : "http://localhost:7474/db/data/index/node",
  "relationship_index" : "http://localhost:7474/db/data/index/relationship",
  "extensions_info" : "http://localhost:7474/db/data/ext",
  "relationship_types" : "http://localhost:7474/db/data/relationship/types",
  "batch" : "http://localhost:7474/db/data/batch",
  "cypher" : "http://localhost:7474/db/data/cypher",
  "neo4j_version" : "1.8.RC1"
}
----


