http-types icon indicating copy to clipboard operation
http-types copied to clipboard

rename `Mime` to `MediaType`

Open yoshuawuyts opened this issue 5 years ago • 8 comments

Tracking issue: #274

I saw akka refers to this as MediaType and quite liked it.

"MIME" is pretty nondescript if you don't know what it is I'm advance. "Media type" seems a bit clearer and in turn more natural to talk about:

"In order to get the media type, call the content_type method on the request"

For search purposes we should probably still mention "MIME" in the docs somewhere, but the type itself being called MediaType would be nice I think.

yoshuawuyts avatar Sep 28 '20 22:09 yoshuawuyts

I'm willing to attempt this if it hasn't been assigned yet and would be accepted.

brightly-salty avatar Dec 05 '20 22:12 brightly-salty

The PR for this will probably be quite small but will only be acceptable once we've gathered all the other semver-major changes, so it may sit for a while and possibly have conflicts.

Fishrock123 avatar Dec 08 '20 01:12 Fishrock123

@Fishrock123 Do you want me to go ahead and create it but let it sit there, or just wait until other semver-major changes are implemented? Thanks

brightly-salty avatar Dec 08 '20 01:12 brightly-salty

And, by the way, if you're looking for contributors for some of these other semver-major issues, I'm open to doing any that are delegated to me. I'm looking to help out however I can.

brightly-salty avatar Dec 08 '20 02:12 brightly-salty

You can open a PR if you'd like, just be aware of those things.

Fishrock123 avatar Dec 08 '20 02:12 Fishrock123

@yoshuawuyts Checking back to confirm this: while MediaType is descriptive, MIME is a "term of art", as well as being shorter. The tradeoff here seems like "more descriptive" (MediaType) versus "more conventional and more convenient" (Mime).

joshtriplett avatar Jan 23 '21 23:01 joshtriplett

"In order to get the media type, call the content_type method on the request"

then why not ContentType? It also makes sense to me.

liigo avatar Feb 19 '21 00:02 liigo

A new set of HTTP specs has just been published, and in the newly stabilized RFC 9110: HTTP Semantics, 8.3: Content-Type defines the Content-Type header like this:

Content-Type = media-type

There's probably a wider question how we want to work with the new specs that's worth its own conversation. Overall they seem like a much needed improvement over the older specs in terms of clarity and consistency. I'm kind of inclined to say that we should start following the terminology used by them, but use aliases to link back to current, commonly-used terminology. In this case that would mean naming the type MediaType, but adding a doc alias so when someone searches for Mime they can find it too.

yoshuawuyts avatar Jun 22 '22 10:06 yoshuawuyts