def get_mimetype_from_response(response, strip_params=False):
    """
    Get the mimetype from the HTTP response
    """
    mimetype = response.getheader('Content-type', None)
    if not mimetype:
        raise ValueError('No Content-Type header in response')
    if strip_params:
        return mimetype.split(';', 1)[0]
    else:
        return mimetype
