<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def request_json(link, outfile, force_rerun_flag, outdir=None):
 """Download a file in JSON format from a web request Args: link: Link to web request outfile: Name of output file outdir: Directory of output file force_rerun_flag: If true, redownload the file Returns: dict: contents of the JSON request """

    if not outdir:
        outdir = ''
    outfile = op.join(outdir, outfile)

    if force_rerun(flag=force_rerun_flag, outfile=outfile):
        text_raw = requests.get(link)
        my_dict = text_raw.json()
        with open(outfile, 'w') as f:
            json.dump(my_dict, f)

        log.debug('Loaded and saved {} to {}'.format(link, outfile))
    else:
        with open(outfile, 'r') as f:
            my_dict = json.load(f)
        log.debug('Loaded {}'.format(outfile))

    return my_dict