我正在使用 django-restframework,我使用邮递员 POST json 数据到我的项目,但我收到类似标题的错误,我已经设置了 raw 和 application/json 这里是邮递员的代码。
POST /account/post/reply/ HTTP/1.1
Host: localhost:8000
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: a0c7bd93-631e-4c7a-8106-87f018eaf7da
{
"user": "michael",
"userid": "1",
"ihelpid": 6,
"tittle": "6",
"info": "6",
"label": "3",
"tel": "dxy970525",
"picture1": null,
"picture2": null
}
Run Code Online (Sandbox Code Playgroud)
我的代码非常简单,就像:
POST /account/post/reply/ HTTP/1.1
Host: localhost:8000
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: a0c7bd93-631e-4c7a-8106-87f018eaf7da
{
"user": "michael",
"userid": "1",
"ihelpid": 6,
"tittle": "6",
"info": "6",
"label": "3",
"tel": "dxy970525",
"picture1": null,
"picture2": null
}
Run Code Online (Sandbox Code Playgroud)
我使用viewsets后,出现此错误,我已将其打印在shell上,但没有问题