Book Image

Neo4j Cookbook

By : Ankur goel, Ankur Goel
Book Image

Neo4j Cookbook

By: Ankur goel, Ankur Goel

Overview of this book

Table of Contents (17 chapters)
Neo4j Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Accessing Neo4j from the command line using curl


Curl is a popular command-line tool used to access and transfer the data using various protocols. Because the REST API uses the HTTP protocol to transfer data, the curl tool becomes a command-line tool that is used to access the REST API, which is exposed by the Neo4j graph database server.

In this recipe, we will learn how to access the Neo4j graph database server using curl.

Getting ready

The service root endpoint by default is http://host:port/db/data/, which can also be seen through the web interface by opening the endpoint URL in the browser. You will see something similar to this:

How to do it...

Let's access the Neo4j graph database server using the REST endpoint via the curl command-line tool:

  1. Start the Neo4j graph database server using the following command:

    $ ./neo4j start
    

    To check whether things are running fine, open http://localhost:7474/db/data/ in a browser.

    The browser sends the text/HTML as the accepted encoding, but in curl, we...