我正在使用 HBase stargate REST API 从 Hbase 获取数据。我有 tabel 'state' 和行键 '1' 。当我在浏览器中粘贴以下行时,我得到了 xml 格式的输出。
http://localhost:8000/state/1
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><CellSet><Row key="MQ=="><Cell column="aW5mbzpjb2xvcg==" timestamp="1459193020823">cmVk</Cell><Cell column="aW5mbzpuYW1l" timestamp="1459192932985">TUg=</Cell></Row></CellSet>
如何获取json格式的输出?
提前致谢。
最佳答案
https://hbase.apache.org/book.html#_using_rest_endpoints
You can request plain text (the default), XML , or JSON output by adding no header for plain text, or the header "Accept: text/xml" for XML or "Accept: application/json" for JSON.
关于rest - HBase REST 返回 json 而不是 xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36270102/