I have the following endpoint which solves this purpose: for a given list of directories, we have to get number of files in them.
@router.get(
"/getFileCountForMultipleDirectories/{directoryList}/"
)
async def get_file_count_for_all_directories(
directoryList: list[str]
):
response_payload = None
# some logic
return response_payload
So ideally, this API has to be a GET call. But if the list of directories is huge, and we know there are URL max character limits, how to still achieve the solution using GET call? Using POST call as a hack for this, and then passing the list as payload to it, does not seem right.