def contains(response, args):
    """This function detects if the body of an http response contains a
    user defined string"""
    phrase = args["phrase"]
    body = response.body
    if body is None:
        if not phrase:
            detected = True
        else:
            detected = False
    else:
        if not args["case_sensitive"]:
            phrase = phrase.lower()
            body = body.lower()
        detected = phrase in body
    if args["reverse"]:
        return not detected
    return detected