0

我有从 rest_framework 的 Response 对象中返回字符串作为响应的端点。

Response(response, status=200, headers={'age': 20}, content_type="text/plain; version=0.0.4")

在上面您可以看到我的响应对象,因为您可以看到我设置的唯一标题是“年龄”。但是,当我检查时,response.items()我可以看到正在添加更多标题:

dict_values([('Content-Type', 'text/plain; version=0.0.4'), ('age', '20'), ('Vary', 'Accept, Cookie'), ('Allow', 'GET, OPTIONS'), ('X-Frame-Options', 'DENY'), ('Content-Length', '213'), ('X-Content-Type-Options', 'nosniff')])

是否有可能以某种方式删除/编辑一些由 django/rest_framework 自动添加的标头?

谢谢!

4

0 回答 0