'Returns the client\'s preferred media type, given several choices.
Args:
media_types (iterable of str): One or more Internet media types
from which to choose the client\'s preferred type. This value
**must** be an iterable collection of strings.
Returns:
str: The client\'s preferred media type, based on the Accept
header. Returns ``None`` if the client does not accept any
of the given types.'

def client_prefers(self, media_types):

    try:
        preferred_type = mimeparse.best_match(media_types, self.accept)
    except ValueError:
        preferred_type = ''
    return (preferred_type if preferred_type else None)
