Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Cyber-Kun |
so I have 1 http request node that I use for multiple requests.
for some of the requests I need to download the files returned by the request
and for others I don’t
so I noticed if I:
func doupdate(path, url, headers):
requestname = "update"
print("doing update")
self.set_download_file(path)
self.request(url, headers)
and then do a request that doesn’t need a file to be downloaded:
func getquota(URL, headers):
print("gettingquota")
requestname = "quota"
print("from getquota()", requestname)
self.request(URL, headers)
on the “getquota()” function it will download that requests file to the previously set file in the doupdate() function. I was wondering if there is a way to clear the download file path property of the http request node.
initially I thought that if you do a httprequest in a function that sets a download file path that that path would only work in that function but if you then do another request it will overwite the file you previously downloaded with the new request’s body.
currently I work around this by just doing:
func getquota(URL, headers):
print("gettingquota")
requestname = "quota"
print("from getquota()", requestname)
self.set_download_file("")
self.request(URL, headers)
so essentially I just set the download file to an empty string. but I’m not sure if this is the “correct way” to go about it