任何人都可以帮我将以下内容转换为java等价物吗?
curl -XGET 'localhost:9200/indexname/status/_search?pretty=1&size=10000' -d '{"_source": {"include": [ "ID", "Name" ]}}'
我试着用这个:
ProcessBuilder pb = new ProcessBuilder("curl","-g","-H Content-Type: application/json", "-H Accept: application/json", "-XGET","http://localhost:9200/indexname/status/_search?pretty=1&size=10000","-d '{\"_source\": {\"include\": [ \"ID\", \"Name\" ]}}'");
在运行java代码时,它返回一个Parse失败异常。有什么建议?感谢。
答案 0 :(得分:0)