2017-05-24 59 views
0

这里我试图在neo4j中执行shortestPath算法。在neo4j中使用REST API时出现404错误

{ 
    method: 'POST', 
    json:true, 
    url: 'http://neo4j:[email protected]:7474/db/data/81/path', 
    body:{ 
     "to" : '/db/data/84', 
     "max_depth" : 2, 
     "relationships" : { 
      "type" : "Meet", 
      "direction" : "out" 
     }, 
     "algorithm" : "shortestPath" 
    } 
}, 

获得响应:

错误:空 体:

{ 
"statusCode":404, 
    "headers": 
     { 
      "date":"Wed, 24 May 2017 05:10:51 GMT", 
      "access-control-allow-origin":"*", 
      "connection":"close", 
      "server":"Jetty(9.2.9.v20150224)" 
     }, 
    "request": 
     { 
     "uri": 
      { 
      "protocol":"http:", 
      "slashes":true, 
      "auth":"neo4j:admin", 
      "host":"localhost:7474", 
      "port":"7474", 
      "hostname":"localhost", 
      "hash":null, 
      "search":null, 
      "query":null, 
      "pathname":"/db/data/81/path", 
      "path":"/db/data/81/path", 
      "href":"http://neo4j:[email protected]:7474/db/data/81/path" 
      }, 
     "method":"POST", 
     "headers": 
      { 
      "authorization":"Basic bmVvNGo6YWRtaW4=", 
      "accept":"application/json", 
      "content-type":"application/json", 
      "content-length":144 
      } 
     } 
} 

请,谁能帮助我这个?

回答

0

您从urlto路径中缺少/node

试试这个:

{ 
    method: 'POST', 
    json:true, 
    url: 'http://neo4j:[email protected]:7474/db/data/node/81/path', 
    body:{ 
     "to" : '/node/84', 
     "max_depth" : 2, 
     "relationships" : { 
      "type" : "Meet", 
      "direction" : "out" 
     }, 
     "algorithm" : "shortestPath" 
    } 
} 
相关问题