http-rs / http-types

Common types for HTTP operations
https://docs.rs/http-types
Apache License 2.0
200 stars 83 forks source link

rename `Mime` to `MediaType` #251

Open yoshuawuyts opened 4 years ago

yoshuawuyts commented 4 years ago

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.

brightly-salty commented 3 years ago

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

Fishrock123 commented 3 years ago

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.

brightly-salty commented 3 years ago

@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 commented 3 years ago

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.

Fishrock123 commented 3 years ago

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

joshtriplett commented 3 years ago

@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).

liigo commented 3 years ago

"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.

yoshuawuyts commented 2 years ago

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.