解析器

from rest_framework.parsers import JSONParser
from rest_framework.parsers import FormParser
from rest_framework.parsers import MultiPartParser
from rest_framework.parsers import FileUploadParser

  

在视图类中使用解析器

class Book_cbv(APIView):
    authentication_classes = []
    # permission_classes = [SVIPpermission(),]
    # throttle_classes = [throttlerate(),]
    parser_classes = []

  

在parset_classes中配置上面的4个类就可以了

 

 

rest_framework的响应器

from rest_framework.response import Response

  

 

相关文章:

  • 2022-01-27
  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-02-23
  • 2019-03-06
  • 2021-11-25
猜你喜欢
  • 2022-12-23
  • 2022-01-12
  • 2021-12-09
  • 2021-12-06
  • 2021-12-26
  • 2021-06-06
  • 2021-10-11
相关资源
相似解决方案