Search code examples
restneo4jneo4j-apocresponse-headers

How to get response headers in neo4j - apoc.load.jsonParams()?


I have the following CQL apoc query in neo4j that works fine to get response payload from a rest GET request:

CALL apoc.load.jsonParams($uri, {Authorization: $Bearertoken}, null)
YIELD value
UNWIND value.items AS item
RETURN item

However, the uri uses pagenation and the next page uri is present in the response header. Therefore, I need a way to retrieve the response header along with the value. Please let me know if there is a way to do this.

Thanks in advance.


Solution

  • The apoc.load.jsonParams procedure does not support returning the response header.

    You can write your own code instead. Here is an article that can help get you started.