#!/usr/bin/python
# -*- coding: utf-8 -*-
# main.py
# It handles a Google Cloud Function that responds to an HTTP request.

def http_request(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/0.12/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!'

#!/usr/bin/python
# -*- coding: utf-8 -*-
# main.py
# It handles a Google Cloud Function that responds to an HTTP request.

def http_request(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/0.12/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!'

#!/usr/bin/python # -*- coding: utf-8 -*- # main.py # It handles a Google Cloud Function that responds to an HTTP 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/0.12/api/#flask.Flask.make_response>`.