设置 http 响应内容类型 django

2022-05-07

以下示例是关于Python中包含设置 http 响应内容类型 django用法的示例代码,想了解设置 http 响应内容类型 django的具体用法?设置 http 响应内容类型 django怎么用?设置 http 响应内容类型 django使用的例子?那么可以参考以下相关源代码片段来学习它的具体使用方法。

[英]:set http response content type django源码类型:Python
reponse = HttpResponse(content)
response['Content-Type'] = 'application/json' # or application/text, etc.

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

本文地址:https://www.itbaoku.cn/snippets/785262.html