curl -XPOST 'http://127.0.0.1:8000/tag/create' \
-H 'content-type:application/json' \
-d '{"tag":"php"}'
from rest_framework.decorators import api_view
from rest_framework.response import Response

@api_view(["POST"])
def tag_create(request):
    print(request.data)
    tag = request.data.get('tag')

标签: django, rest

添加新评论