Neo4j PHP绘图软件&x27;415不支持的媒体类型';
以下测试用例(假设密码正确) 这是我卸载$client时的$client:Neo4j PHP绘图软件&x27;415不支持的媒体类型';,php,neo4j,cypher,Php,Neo4j,Cypher,以下测试用例(假设密码正确) 这是我卸载$client时的$client: object(GraphAware\Neo4j\Client\Client)#7 (2) { ["connectionManager":protected]=> object(GraphAware\Neo4j\Client\Connection\ConnectionManager)#2 (2) { ["connections":"GraphAware
object(GraphAware\Neo4j\Client\Client)#7 (2) {
["connectionManager":protected]=>
object(GraphAware\Neo4j\Client\Connection\ConnectionManager)#2 (2) {
["connections":"GraphAware\Neo4j\Client\Connection\ConnectionManager":private]=>
array(1) {
["default"]=>
object(GraphAware\Neo4j\Client\Connection\Connection)#4 (5) {
["alias":"GraphAware\Neo4j\Client\Connection\Connection":private]=>
string(7) "default"
["uri":"GraphAware\Neo4j\Client\Connection\Connection":private]=>
string(38) "http://neo4j:Password@localhost:7474"
["driver":"GraphAware\Neo4j\Client\Connection\Connection":private]=>
object(GraphAware\Neo4j\Client\HttpDriver\Driver)#6 (2) {
["uri":protected]=>
string(38) "http://neo4j:Password@localhost:7474"
["config":protected]=>
object(GraphAware\Neo4j\Client\HttpDriver\Configuration)#5 (1) {
["timeout":protected]=>
int(5)
}
}
["session":"GraphAware\Neo4j\Client\Connection\Connection":private]=>
NULL
["timeout":"GraphAware\Neo4j\Client\Connection\Connection":private]=>
int(5)
}
}
["master":"GraphAware\Neo4j\Client\Connection\ConnectionManager":private]=>
NULL
}
["eventDispatcher":protected]=>
object(Symfony\Component\EventDispatcher\EventDispatcher)#8 (2) {
["listeners":"Symfony\Component\EventDispatcher\EventDispatcher":private]=>
array(0) {
}
["sorted":"Symfony\Component\EventDispatcher\EventDispatcher":private]=>
array(0) {
}
}
}
我不知道如何解释这一点,也不知道是什么错
- 我的数据库在neo4j浏览器客户端中正常运行
- 据我所知,graphaware已按照
正确安装 网站上的说明 - 我已经测试过,错误发生在运行查询时, 不是在创建客户机时(即使这不是 由错误明确指示)
- 如果我将查询直接复制/粘贴到neo4j浏览器客户端 然后它就如预期的那样工作了
public function flush(Pipeline $pipeline)
{
$request = $this->prepareRequest($pipeline);
try {
$response = $this->httpClient->sendRequest($request);
value of request
[headers:GuzzleHttp\Psr7\Request:private] => Array
(
[Host] => Array
(
[0] => localhost:7474
)
[0] => Array
(
[X-Stream] => 1
[Content-Type] => application/json
)
)
非常确定请求应该是这样的:
Array
(
[Host] => Array
(
[0] => localhost:7474
)
[X-Stream] => 1
[Content-Type] => application/json
)
为了解决这个问题,我修改了PrepareRequest函数以生成正确的头
// Line 197
$headers = [
'X-Stream' => true,
'Content-Type' => 'application/json'
];
Array
(
[Host] => Array
(
[0] => localhost:7474
)
[X-Stream] => 1
[Content-Type] => application/json
)
// Line 197
$headers = [
'X-Stream' => true,
'Content-Type' => 'application/json'
];