Api-Platform:此值不应为空

时间:2016-02-11 11:21:46

标签: symfony api-platform.com

我刚刚开始测试dunglas / DunglasApiBundle的演示

https://api-platform.com/doc/1.0/api-bundle/getting-started#configuring-the-api

但每次我尝试发出POST请求时都会出现此错误。

{
    "@context": "/api/contexts/ConstraintViolationList",
    "@type": "ConstraintViolationList",
    "hydra:title": "An error occurred",
    "hydra:description": "name: This value should not be blank.\n",
    "violations": [
        {
            "propertyPath": "name",
            "message": "This value should not be blank."
        }
    ]
}

2 个答案:

答案 0 :(得分:0)

您正在使用需要"名称" POST请求正文中的值

答案 1 :(得分:0)

它似乎是唯一可接受的发送数据的形式是json格式