标签: django-rest-framework postman
我想在 POST 请求中通过邮递员发送数组。我想发送这样的数据
{ "users": [1, 2] }
我读过这篇文章Is it possible to send an array with the Postman Chrome extension?
并转载,但收到错误(见图)。 我该如何修复错误?
我正在使用 django rest 框架,服务器回答了这个问题
request["users"] is None
答案 0 :(得分:2)
您不能通过 formdata 发送数组,如果您的端点需要 json 则将其作为 body>raw>json 发送: