def METHOD_NAME(f: flow.Flow) -> str:
    request = cleanup_request(f)
    request = pop_headers(request)
    args = ["curl"]
    server_addr = f.server_conn.peername[0] if f.server_conn.peername else None
    if (
        ctx.options.export_preserve_original_ip
        and server_addr
        and request.pretty_host != server_addr
    ):
        resolve = f"{request.pretty_host}:{request.port}:[{server_addr}]"
        args.append("--resolve")
        args.append(resolve)
    for k, v in request.headers.items(multi=True):
        if k.lower() == "accept-encoding":
            args.append("--compressed")
        else:
            args += ["-H", f"{k}: {v}"]
    if request.method != "GET":
        args += ["-X", request.method]
    args.append(request.pretty_url)
    if request.content:
        args += ["-d", request_content_for_console(request)]
    return " ".join(shlex.quote(arg) for arg in args)