When I create a Google Cloud function through Cloud Console, there is a default function:
def hello_world(request):
"""Responds to any HTTP request.
Args:
request (flask.Request): HTTP request object.
Returns:
The response text or any set of values that can be turned into a
Response object using
`make_response <http://flask.pocoo.org/docs/1.0/api/#flask.Flask.make_response>`.
"""
request_json = request.get_json()
if request.args and 'message' in request.args:
return request.args.get('message')
elif request_json and 'message' in request_json:
return request_json['message']
else:
return f'Hello World!'
I would like to test this locally. When I deploy it, I will write this to my browser:
https://region-project.cloudfunctions.net/function-1?message={"a"=1,"b"=2}
To test hello_world
, I need to pass it the dict I am passing to my function in the HTTP request above in some form. What is processing
, if I expect hello_world(processing({"a"=1,"b"=2}))
to output the same thing as a deployed Cloud Function would output to browser as a response to the request https://region-project.cloudfunctions.net/function-1?message={"a"=1,"b"=2}?