据我所知,他们是绝对平等的。然而,浏览一些 django 文档,我已经 找到了这段代码:
HttpResponse.__init__(content='', mimetype=None, status=200, content_type='text/html')
这让我很惊讶他们两个相处得这么好。官方文件能够以务实的方式解决这一问题:
Content _ type 是 imetype 的别名。 从历史上看,这个参数只是 called mimetype, but since this is 实际上包含在 HTTP Content-Type 头,它也可以 include the character set encoding, 这就不仅仅是个 MIME 了 类型规范 如果指定(不是“无”) ,则该值为 否则,将使用 content _ type。 如果两者都没有给出,则 使用 DEFAULT _ CONTENT _ TYPE 设置。
然而,我觉得它不足以说明问题。为什么我们对(几乎相同的)事物使用两种不同的命名方式?“ Content-Type”仅仅是浏览器请求中使用的一个名称吗?
What's the main difference between the each one, and when is right to call something mimetype
as opposed to content-type
? Am I being petty and a grammar nazi?