Inside “Hello World!”
bn create creates a local Python file called function.py. Let’s take a look inside:
The function receives two arguments.
body holds the HTTP request body, and
req holds HTTP request and response parameters, like query string and headers. The Returned object is automatically JSON-ified and sent back as the HTTP response body.
Read more about function signatures in the reference.
Sending arguments to the function
Modifying the code
Let’s tweak the function a bit to return the input string in reverse order. First, let’s change the return statement:
Now, let’s deploy and invoke:
- Next Tutorial: Read cloud logs
- Read the full manual