Kong 1.0.3主机必填字段缺失

时间:2019-03-12 12:26:42

标签: kong

我是新来的香港人,当我尝试使用 Kong 1.0.3

POST 一项服务时遇到问题

这是使用邮递员发送的POST URL

http://localhost:8001/services?name=GOT&protocol=https&host=anapioficeandfire.com&path=/api

Screenshot with the Postman UI

在明确指定主机的同时,我收到错误400 Bad Request

{
    "message": "schema violation (host: required field missing)",
    "name": "schema violation",
    "fields": {
        "host": "required field missing"
    },
    "code": 2
}

但是,当我按照Kong的要求开始创建服务时,我没有遇到任何问题。该命令可以正常工作:

curl -i -X POST \
  --url http://localhost:8001/services/ \
  --data 'name=example-service' \
  --data 'url=http://mockbin.org'

谢谢

1 个答案:

答案 0 :(得分:0)

如您所见,卷曲“ --data”以发送POST请求,因此将请求中的所有参数(“?”之后)放入邮递员的BODY中,单击“发送”,您将获得成功!

this is my postman request's image