'Return the \'encoding\' parameter to use for a given endpoint.'

def get_encoding(self, path, method, view):

    supported_media_types = set(('application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'))
    parser_classes = getattr(view, 'parser_classes', [])
    for parser_class in parser_classes:
        media_type = getattr(parser_class, 'media_type', None)
        if (media_type in supported_media_types):
            return media_type
        if (media_type == '*/*'):
            return 'application/octet-stream'
    return None
