Jaymon / endpoints

Lightweight REST api backend framework that automatically maps urls to python modules and classes
MIT License
29 stars 10 forks source link

content_type should be replaced with media_type when it refers to the "type/tree" #145

Open Jaymon opened 4 days ago

Jaymon commented 4 days ago

This affects Request and Response and probably some other places (including the RESPONSE_CONTENT_TYPE environment variable). I basically use content_type for media_type in a bunch of places and I should switch them all because I almost always mean media_type when I'm using content_type

Reading:

Jaymon commented 4 days ago

Ugh, this is Content-Type abnf:

Content-Type = media-type
media-type = type "/" subtype *( OWS ";" OWS parameter )
parameter = token "=" ( token / quoted-string )

So I was wrong above. Content-Type is just the name of the http header, and its value is a media-type, and a media-type value can have the parameters on it.

More reading: