Created
March 12, 2020 21:25
-
-
Save WouterNieuwerth/1a941e5883bb3537f69955273d703f5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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_json and 'example_content' and 'another_example_content' in request_json: | |
example_content = request_json['example_content'] | |
another_example_content = request_json['another_example_content'] | |
# Do whatever you want with the data from the json | |
return str(example_content) | |
else: | |
return f'Error, no example_content or another_example_content found in json' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment