【问题标题】:How to insert data into HBase through StarGate REST API如何通过 StarGate REST API 将数据插入 HBase
【发布时间】:2012-06-10 20:42:27
【问题描述】:

根据 StarGate 文档,CURL 命令应如下所示:

% curl -H "Content-Type: text/xml" --data '[...]' http://localhost:8000/test/testrow/test:testcolumn

这就是我正在尝试的:

% curl -X POST -H "Accept: text/xml" --data '[<CellSet><Row key="cm93MQ=="><Cell column="dGl0bGU6YQ==">d29ya2Vk</Cell></Row></CellSet>]' http://localhost:8080/test/row1/title

不断收到 HTTP 415,不支持的媒体类型.. 任何想法我在那里缺少什么?

【问题讨论】:

    标签: hadoop hbase stargate


    【解决方案1】:

    您当前的 curl 选项指定您想要 XML 输出,并且 curl 假设您发布的是 url 编码的表单数据(并在 HTTP 标头中指定了错误的 Content-Type)。

    将您的-H "Accept: text/xml" 修改为-H "Content-Type: text/xml",您应该会很好

    【讨论】:

    • 好吧,现在出现了不同类型的错误,也许它越来越接近:错误 400 错误请求
    • 应该将 [] 方括号放在 XML 周围吗?表“测试”是否存在?
    • 知道了,是 [] 括号!!非常感谢!
    猜你喜欢
    • 2012-04-17
    • 2015-10-11
    • 2011-01-09
    • 2014-01-23
    • 2013-01-14
    • 2014-09-04
    • 1970-01-01
    • 2019-07-07
    • 1970-01-01
    相关资源
    最近更新 更多