Would like to call this function inside of another function so that I can process the new file elsewhere. I am currently using python3 requests library to do this (but it's not working)
def handle(req):
"""handle a request to the function
Args:
req (str): request body
"""
arg = req
WHERE ARG IS THE URL I WANT TO PROCESS
r = requests.get("http://gateway:8080/function/hello-openfaas", data=arg)
#ALSO TRIED
# r = requests.get("http://gateway:8080/function/hello-openfaas", data=arg)
print(r.text)
return req
Expected Behaviour
Expect to get back the binary that is printed out when run on the command line.
Current Behaviour
Currently I am getting an error cannot connect, connection refused error from python. So, it's not to do with openFaas, but more how to contact the openFaas function using requests.
Possible Solution
Update readMe.md?
Steps to Reproduce (for bugs)
copy and paste code? It's a pretty simple "bug"
Context
Need to have a function call this one to get the encoding for the video, saved into that r variable, so that I can save it into a mov file, so that I can process the mov file in another function.
Hi thank you for your interest, please can you create a GitHub repo with all the code you are using and then seek out technical support on Slack? Thank you
Would like to call this function inside of another function so that I can process the new file elsewhere. I am currently using python3 requests library to do this (but it's not working)
def handle(req): """handle a request to the function Args: req (str): request body """ arg = req
WHERE ARG IS THE URL I WANT TO PROCESS
Expected Behaviour
Expect to get back the binary that is printed out when run on the command line.
Current Behaviour
Currently I am getting an error cannot connect, connection refused error from python. So, it's not to do with openFaas, but more how to contact the openFaas function using requests.
Possible Solution
Update readMe.md?
Steps to Reproduce (for bugs)
copy and paste code? It's a pretty simple "bug"
Context
Need to have a function call this one to get the encoding for the video, saved into that r variable, so that I can save it into a mov file, so that I can process the mov file in another function.