curl访问Neo4j Restful API

-H 'Content-type:application/json'   :后面不能有空格




curl --user username:password http://localhost:7474/db/data/
curl --user neo4j:123456 http://127.16.197.36:7474/db/data/


json未转义:
curl -X POST "http://neo4j:[email protected]:7474/db/data/cypher" -H 'Content-type:application/json;charset=UTF-8'  -d '{ "query": " Match(a) where {value} in a.type_object_name return  a " , "params":{"value" : "美国"} }'


json转义:



curl -X POST -H 'Content-type:application/json' -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" 'http://neo4j:[email protected]:7474/db/data/cypher' -d '{ "query": " Match(a) where {value} in a.type_object_type return  a.type_object_name ", "params":{"value" : "geography_mountain"} }'
curl -X POST -H 'Content-type: application/json' 'http://neo4j:[email protected]:7474/db/data/cypher' -d '{ "query": " Match(a) where {value} in a.type_object_type return  a.type_object_name ", "params":{"value" : "geography_mountain"} }'


curl -X POST -H 'Content-type:application/json;charset=UTF-8' -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" 'http://neo4j:[email protected]:7474/db/data/cypher' -d '{ "query": " Match(a) where {value} in a.type_object_name return  a " , "params":{"value" : "美国"} }'


curl -X POST -H 'Content-type:application/json;charset=UTF-8' 'http://neo4j:[email protected]:7474/db/data/cypher' -d '{ "query": " Match(a) where {value} in a.type_object_name return  a " , "params":{"value" : "美国"} }'


//create a node
curl -X POST -H 'Content-type: application/json' -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" 'http://neo4j:[email protected]:7474/db/data/cypher' -d '{"query" : "CREATE (n:Person { name : {name} }) RETURN n","params" : {  "name" : "Andres"}}'



curl -X POST -H 'Content-type: application/json;charset=UTF-8' -s -w "time_connect: %{time_connect}\ntime_starttransfer: %{time_starttransfer}\ntime_total: %{time_total}\n" 'http://neo4j:[email protected]:7474:7474/db/data/cypher' -d '{ "query": " MATCH p=()-[r:geography_lake_city]->() RETURN p LIMIT 25 " }'





{
  "query" : "MATCH (x {name: {startName}})-[r]-(friend) WHERE friend.name = {name} RETURN TYPE(r)",
  "params" : {
    "startName" : "I",
    "name" : "you"
  }
}

猜你喜欢

转载自blog.csdn.net/wzwdcld/article/details/81541080