Gremlin TinkerPop3通过浏览器进行休息测试
在发出以下请求时,我得到了有效的响应:Gremlin TinkerPop3通过浏览器进行休息测试,gremlin,tinkerpop3,Gremlin,Tinkerpop3,在发出以下请求时,我得到了有效的响应: bin/gremlin-server.bat conf/gremlin-server-rest-modern.yaml curl "http://localhost:8182?gremlin=100-1" curl "http://localhost:8182?gremlin=g.V()" 但通过浏览器,我得到以下信息: {"message":"no gremlin script supplied"} 也按以下方式进行了尝试,但没有结果: http:
bin/gremlin-server.bat conf/gremlin-server-rest-modern.yaml
curl "http://localhost:8182?gremlin=100-1"
curl "http://localhost:8182?gremlin=g.V()"
但通过浏览器,我得到以下信息:
{"message":"no gremlin script supplied"}
也按以下方式进行了尝试,但没有结果:
http://localhost:8182/gremlin?script=g.V()
http://localhost:8182/graphs/tinkergraph/tp/gremlin?script=g.traversal().V()
http://localhost:8182/graphs/tinkergraph/tp/gremlin?script=g.V()
任何关于通过浏览器传递脚本的有效方式的建议。我不确定这是否是一个“错误”,但Gremlin服务器不尊重非常复杂的接受
标题。例如,当我尝试在Chrome中解析您的前两个URL之一时,我得到:
{
message: "no serializer for requested Accept header: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
}
默认情况下,Gremlin服务器不支持ACCEPT
。如果浏览器请求了application/json
或仅仅是*.
,它就会工作。请注意,*.
与quality0.8
一起出现,但Gremlin Server没有以这种方式解析标头来确定这一点。因此,它无法找到序列化程序来正确处理该问题
据我所知,浏览器没有解决方法。我创建了一个问题来修复此问题:
当我在启动gremlin server之前忘记启动cassandra时,我也看到了这个错误。由于您的问题,我找到了答案,因此我将为@stacey morgan争取正确答案: 您已在CLI上查询:
curl "http://localhost:8182?gremlin=100-1"
那么您可能已经询问过(因为您的问题不清楚)
或者你做过的其他事情,就像我做的那样:
http://localhost:8182/gremlin?script=g.V()
您将得到错误消息。
正确的方法是从curl命令粘贴“”的内容。所以
http://localhost:8182?gremlin=100-1
然后类似地,对于其他查询:
http://localhost:8182/?gremlin=g.V()
http://localhost:8182/?gremlin=g.traversal().V()
注意:尾随斜杠可能在那里,尽管它在我的FF上没有它也可以工作。这就是HTTP
使用:Ubuntu&Titan1.0.0-hadoop1。我的问题是由于请求中存在空格 这起作用了
curl http://localhost:8182/?gremlin="g.V().has('name','foody')"
但事实并非如此
curl http://localhost:8182/?gremlin="g.V().has('name', 'foody')"
尝试将它们从您的中删除,它们应该会起作用。谢谢,我的问题正是如此。
curl http://localhost:8182/?gremlin="g.V().has('name', 'foody')"