<form enctype='application/json' action="{% url 'xxx' %}" method="post">
{% csrf_token %}
<input type='number' name='bottle-on-wall' value='1'>
<input type='number' name='bottle-on-wall' value='2'>
<input type='number' name='bottle-on-wall' value='3'>
<button type="submit">send</button>
</form>
CONTENT_TYPE 'application/x-www-form-urlencoded'
如何将表单数据以 json 形式发送到服务器
使用
multipart/form-data
<form enctype='multipart/form-data' action="{% url 'xxx' %}" method="post">
{% csrf_token %}
<input type='number' name='bottle-on-wall' value='1'>
<input type='number' name='bottle-on-wall' value='2'>
<input type='number' name='bottle-on-wall' value='3'>
<button type="submit">send</button>
</form>