###二、Response(响应) 你需要使用一个APIView类或@api_view函数返回response对象的views ####1.创建Response from rest_framework.response import Response
例: Response(data, status=None, template_name=None, headers=None, content_type=None)
data: 响应serialized(序列化)后的数据
status: 定义响应状态码,默认200
template_name: 如果HTMLRender被选择,返回一个模板
headers: 是关于HTTP请求头的一个字典
content_type: 响应内容类型,一般会根据内容自动协商。
####2.其他标准的HttpResponse属性
response = Response()
response[‘Cache-Control’] = ‘no-cache’
.render(): 响应序列化的数据。