How to generate URL from @app.route url in FLASK?

I have a Flask code with decorator @app.route(/bestApp) to fetch my data from Fetch API javascript.

this is my :

@app.route('/bestApp', methods=['GET', 'POST'])
def bestapp():
   app_data = AppDataFromUrl(app_url)
   return send_from_directory(directory=permitted_directory, path=filename,as_attachment=True)

and this is my script.js

async function getExtract() {
  try {
    const response = await fetch("/bestApp", {
      method: "post",
      body: new FormData(document.querySelector(".testform")),


whenever i download my file, it works but the problem is the link that shown in browser is like “

how to convert to normal URL? such

I don’t wanna use Blob Object Url or Data URI.