def METHOD_NAME(entity):
    # 'headers' is a field of 'request', but it is a dict-key in 'response'
    headers = getattr(entity, "headers", None)
    if headers is None:
        headers = entity.get("headers")
    content_type = None
    if headers:
        content_type = headers.get("content-type", None)
        if content_type:
            # content-type could an array from response, let us extract it out
            content_type = content_type[0] if isinstance(content_type, list) else content_type
            content_type = content_type.split(";")[0].lower()
    return content_type