buddy-http-api回复未经授权

时间:2016-06-24 04:16:01

标签: node.js api docker

Hello Stackoverflower,

我正在使用泊坞窗设置buddy-http-api

在docker容器启动完成后,我ssh到docker容器以测试API。

我跑:

curl http://localhost:9123/api/account -X POST -H "Content-Type: application/json" \
     -H "Accept: application/json" \
     -d "{ \
           \"username\": \"user2@ab.com\", \
           \"password\": \"12345678\", \
           \"email\": \"thanh.nguyen2891@gmail.com\"\
         }"

我得到了:

Unauthorized

我不确定如何将其用于身份验证。我看过http://buddycloud.com/api#create-post

日志:

 {
  "req": {
    "url": "/api/account",
    "headers": {
      "user-agent": "curl/7.35.0",
      "host": "localhost:9123",
      "accept": "*/*",
      "content-type": "application/json; charset=utf-8",
      "content-length": "45"
    },
    "method": "POST",
    "httpVersion": "1.1",
    "originalUrl": "/api/account",
    "query": {}
  },
  "res": {
    "statusCode": 401
  },
  "responseTime": 1,
  "level": "info",
  "message": "HTTP POST /api/account"
}

提前致谢!

0 个答案:

没有答案