Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should Use "Type" By Default #7

Open
yfeldblum opened this issue Jul 25, 2012 · 1 comment
Open

Should Use "Type" By Default #7

yfeldblum opened this issue Jul 25, 2012 · 1 comment

Comments

@yfeldblum
Copy link

The field name should be e.g. image_type or image_mime_type, referring to the image's MIME type, rather than image_content_type, since only MIME-like messages have content types.

"Content-Type" comes from the HTTP response (and multipart request header) header of that name. There are many headers prefixed with Content- though, including Content-Length and Content-Encoding, and their purpose is to describe the content of the HTTP response. As an example of their meaning: the Content in this response has a Type of application/html, a Length of 12943 in bytes, and an Encoding of gzip.

The following are standard headers in HTTP request messages, HTTP response messages, or multipart/form-data messages:

  • Content-Disposition
  • Content-Encoding
  • Content-Language
  • Content-Length
  • Content-Location
  • Content-MD5
  • Content-Range
  • Content-Transfer-Encoding
  • Content-Type

They describe the Content part of the message, just like the field image_type should describe the image part of the model object.

@gzigzigzeo
Copy link
Owner

I could agree with this but existing projects are already using content_type name unfortunately. I'll add alias attribute _type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants