【问题标题】:Usergrid new application creation parsing errorUsergrid新应用创建解析错误
【发布时间】:2014-09-08 15:53:49
【问题描述】:

我在创建新应用程序时遵循 Apache Usergrid 文档时遇到解析错误。

curl -H "Authorization: Bearer <authorization token>" -H "Content-Type: 
application/json" -X POST -d '{ "name" : "resturantapp" }' http://localhost:8080
/management/orgs/ResturantOrg/apps

我遵循的指令是:

curl -H "Authorization: Bearer [the management token from above]" \
-H "Content-Type: application/json" \
-X POST -d '{ "name":"myapp" }' \
http://localhost:8080/management/orgs/myfirstorg/apps

但我得到的错误是: curl:(3)[globbing] 位置 14 处不匹配的右大括号/方括号 {“错误”:“json_parse”,“时间戳”:1410189449209,“持续时间”:0,“异常”:“org.co dehaus.jackson.JsonParseException","error_description":"意外字符('n ' (code 110)): 期望在 [Source: org. apache.usergrid.rest.filters.MeteringFilter$InputStreamAdapter@5ce201;线:1, 列:4]"}

我看不到我在哪里输入了 Unexpected 字符。

【问题讨论】:

    标签: apache usergrid


    【解决方案1】:

    Alex,你的 curl 对我来说看起来是正确的,但也许可以尝试不同的格式(注意标记在查询字符串中):

    curl -X POST https://api.usergrid.com/management/organizations//applications?access_token= -d '{"name":"myapp"}'

    我刚刚针对我的设置成功运行了这个调用。

    【讨论】:

    • 我刚刚在 Linux VM 上设置了 usergrid 并运行了我上面的 curl,它工作得很好,所以我觉得它可能与 Windows 部署有关用户网格。
    • 在 Windows 上,除非您使用 cygwin,否则您必须转义 curl 命令。
    猜你喜欢
    • 2012-11-16
    • 2011-11-08
    • 2023-03-23
    • 1970-01-01
    • 2017-07-01
    • 2016-07-06
    • 1970-01-01
    • 1970-01-01
    • 2011-05-19
    相关资源
    最近更新 更多