Skip to content

Should Use "Type" By Default #7

Open
@yfeldblum

Description

@yfeldblum

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions