WPF应用程序和Neo4j Client总是向我抛出404

问题描述 投票:0回答:1

我正在使用neo4j Client v4.0.0.1,只想从一个类中创建一个节点,但是我总是收到以下404错误。

错误代码:

System.Exception: 'Received an unexpected HTTP status when executing the request.

The response status was: 404 Not Found

The response from Neo4j (which might include useful detail!) was: '

如果我使用curl检查是否一切都很好:

curl -I localhost:7474
HTTP/1.1 200 OK
Date: Tue, 25 Feb 2020 14:23:18 GMT
Access-Control-Allow-Origin: *
Content-Type: application/json;charset=utf-8
Content-Length: 223

和:

curl -I http://localhost:7474/db/data
HTTP/1.1 302 Found
Date: Tue, 25 Feb 2020 14:23:26 GMT
Location: http://localhost:7474/db/data/
Content-Length: 0

一切似乎都很好。那就是我的尝试,我想从以下开始:

public class Person
    {
        public string Name { get; set; }
        public int Id { get; set; }
        public int Age { get; set; }
    }

private void createNode(){
            var client = new GraphClient(new Uri("http://localhost:7474/db/data/"), "neo4j", "neo4j");

        client.Connect();

        var results = client.Cypher
                    .Create("(n:Person)")
                    .Return((a) => new {
                        Person = a.As<Person>()
                    }).Results;

    }
c# neo4j neo4jclient
1个回答
0
投票

我建议使用Neo4j驱动程序。我不确定neo4j客户端.net库是否支持Neo4j 4.0。另外,您可以返回3.5版本

© www.soinside.com 2019 - 2024. All rights reserved.