0

我一直在尝试创建一个会话,即使使用 curl 它也给了我一些奇怪的东西(我在这篇文章中擦除了 app id 和 auth 键):

curl -X POST \
-H "Content-Type: application/json" \
-H "QuickBlox-REST-API-Version: 0.1.0" \
-d '{"application_id": "XXX", "auth_key": "XXXXXXXXXXXXXX", "timestamp": $(date -j -f "%a %b %d %T %Z %Y" "`date`" "+%s"), "nonce": "1236221330", "signature": "b51f77e6a233db78a3785e3cf8b27aa4e151bd96"}' \
https://api.quickblox.com/session.json

有了这个,我得到了这个 HTML 正文:

<body>
  <!-- This file lives in public/500.html -->
  <div class="dialog">
    <h1>We're sorry, but something went wrong.</h1>
    <p>We've been notified about this issue and we'll take a look at it shortly.</p>
  </div>
</body>

该示例几乎直接来自文档,除了时间戳部分。签名有什么我做错了吗?

4

2 回答 2

2

试试这个参数格式

-d "application_id=140&auth_key=7quWEh-k6TqghXe&timestamp=1326964049&nonce=414546828&signature=e6e603c251a569e70a2f27a8c71b5017e81e05d5" 

不是 json 正文

于 2013-08-01T07:47:07.337 回答
0

这个 CURL 示例工作正常

curl -X POST -H "Content-Type: application/json" -H "QuickBlox-REST-API-Version: 0.1.0" 
-d '{"application_id":"1","auth_key":"gHT98dDU2zpkKej","nonce":"33432","timestamp":"1375384935","signature":"242f6407b4cd6f0b06d1bca67faac4b57eb21c26"}' http://api.quickblox.com/session.json

只需在终端中输入

于 2013-08-01T19:24:30.250 回答