'Media Types parsing according to RFC 2616, section 3.7.
Returns the data type and parameters. For example:
Input: "text/plain; charset=iso-8859-1"
Output: (\'text/plain\', {\'charset\': \'iso-8859-1\'})'

def _parse_content_type(self, ctype):

    (content_type, _, params) = ctype.partition(u';')
    content_params = {}
    for parameter in params.split(u';'):
        (k, _, v) = parameter.strip().partition(u'=')
        content_params[k] = v
    return (content_type, content_params)
