Tries to match the given type to the given preferences. In case there are multiple matches the most specific one will be chosen as per RFC 7231.
Type for which the matching weight is needed.
Preferences to match the type to.
The corresponding weight from the preferences or 0 if there is no match.