django rest framework 的api返回html

return Response(data=serializer.data, status=status.HTTP_200_OK, content_type="application/json")
content_type="application/json"去掉,写成:
return Response(data=serializer.data, status=status.HTTP_200_OK)即可

posted on 2018-10-18 23:25  工大只有一个阿锤  阅读(951)  评论(0编辑  收藏  举报

导航