As far as I know, they are absolutely equal. However, while looking through some django docs, I found this piece of code:
HttpResponse.__init__(content='', mimetype=None, status=200, content_type='text/html')
which surprise me in that they get along with each other. Official documents were able to solve the problem in their own way:
content_type is an alias for mimetype. Historically, this parameter was called mimetype, but since it is actually a value included in the HTTP Content-Type, it can also include character set encoding, which makes it more than just a MIME type specification. If the mimetic is (not None), this value is equally used. Otherwise, content_type is used. If none of them are specified, the DEFAULT_CONTENT_TYPE parameter is used.
However, I do not find this clarifying enough. Why do we use 2 different names for (almost the same) thing? Is "Content-Type" just a name used in browser requests and with very little use outside of it?
What is the main difference between each, and when is it right to call something a mimetype , not a content-type ? Am I a pitty and a Nazi grammar?
content-type python mime-types django
Frangossauro Aug 10 2018-10-10T00: 00Z
source share