Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions fri/test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import requests
import os
import webbrowser

# function to test upload() method.
def upload():
Expand Down Expand Up @@ -36,9 +37,12 @@ def execute():

return response.text

# ********
# To Download call the url .../download/test?fetch=<filename>&apikey=xyz
# or
def download():
url = "http://127.0.0.1:5000/download/test?fetch=f1.txt&apikey=xyz"
webbrowser.open(url)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are opening a web browser in the call to the download() method. I think you should just receive the HTTP Response stream and save it as a file. Check how this is handled in CONTROL-CORE Mediator:

def ctl(dir=None):

This may be more complex than just opening the browser.

Python has the means to save the HTTP response streams to enable the download() options without relying on an external webbrowser.


upload()
execute()
download()