def loop_bodies(k: int, url_path: str, lines: list) -> dict:
    """
    We loop lines here to extract :
    - query params
    - command to execute
    - response to return
    """

    extracted_params = {
        "command": [],
        "body_params": [],
        "query_params": [],
        "res": "request sent.",
    }
    # There are some query params
    if "?" in url_path:
        for p in url_path.split("?")[1].split("&"):
            extracted_params["query_params"].append(p)

    for j in range(k, len(lines)):
        if len(lines[j]) <= 2:
            break

        if "var:" in lines[j]:
            extracted_params["body_params"] = (
                lines[j].split("var:")[1].replace("\n", "").replace(" ", "").split(",")
            )

        if "cmd:" in lines[j]:
            extracted_params["command"].append(
                lines[j].split("cmd:")[1].lstrip().rstrip()
            )

        if "res:" in lines[j]:
            extracted_params["res"] = lines[j].split("res:")[1].lstrip().rstrip()

    return extracted_params