Neo4j API url is:
When I use Chrome visiting this url, which is a GET request. This is the response I got
But when I use the restful client such as POSTMAN to make a g request.
This is the response I got.
My questions are
Both are GET request to the same url. Why Chrome browsing get a html page in return but Postman Request get JSON Response in return.
How Neo4j does that?
Is Neo4j using user agent detection, and if it is a browser visiting, it will give HTML page as response. And if it is a rest client request, it will give json response?
They use media type negotiation header. For example when requesting this site my browser send a header like that:
As you can see it accepts primarily
html, if that's not being served then
xhtml, then pure
xml, and if that's not available - it accepts whatever the server can throw at it.
Neo4j's website tries to serve content in that order. Postman likely specifies
application/json, or nothing at all (the application determines the default media type then), hence the response.