📜  设置 http 响应内容类型 django - Python 代码示例

📅  最后修改于: 2022-03-11 14:45:04.519000             🧑  作者: Mango

代码示例1
reponse = HttpResponse(content)
response['Content-Type'] = 'application/json' # or application/text, etc.

# one-line usage
reponse = HttpResponse(content, content_type:'application/json')