【发布时间】:2013-09-09 18:09:34
【问题描述】:
我通过调用 HttpResponse 在我的 django 视图中创建了一个响应对象
myResponse = HttpResponse("Here is some text")
并且我想将响应上的 Access-Control-Allow-Credentials 标头设置为 true。是否应该像我为其他标题一样使用 python 字符串设置
myResponse['Access-Control-Allow-Credentials'] = 'true'
或使用 python 布尔值
myResponse['Access-Control-Allow-Credentials'] = True
或者两者都行吗? (如果它们在技术上都可以工作,那就更“正确”了)
【问题讨论】:
标签: python django http-headers