Call a function over its public HTTPS URL, from the command line with curl or from MyAccount
with Post Request. The URL has the form
https://<function-name>-<suffix>.serverless.e2enetworks.net/. <function-name> is the name you
gave the function. The suffix is the same for every function in your account.
Before you begin
Section titled “Before you begin”You need a function whose Status reads Running. To copy its URL, select the function in the Functions list and open the Info tab below the list. The function’s own page shows the URL too.
Call the function with curl
Section titled “Call the function with curl”A GET request returns the function’s response:
curl https://<function-name>-<suffix>.serverless.e2enetworks.net/A POST request with a JSON body does the same:
curl -X POST -H "Content-Type: application/json" -d '{"key": "value"}' \ https://<function-name>-<suffix>.serverless.e2enetworks.net/Replace the address with your function’s URL. The response is whatever the handler returns.
Call the function from MyAccount
Section titled “Call the function from MyAccount”- In Compute > Functions, click the function’s name to open its page.
- Click Try. The Enter Arguments panel opens.
- In User Input, enter the JSON arguments for the call.
- Click Post Request.
The response shows in Output, with Runtime Logs beside it.
How the function answers
Section titled “How the function answers”In the Python and Node.js HTTP runtimes, a function answers cross-origin requests from any
origin by default. The response carries Access-Control-Allow-Origin: *.
In the same runtimes, a function accepts JSON bodies up to 10 MB by default. Another content
type, such as text/plain, gets HTTP 415. A larger body gets HTTP 413. You can change these
defaults, and which origins a browser can call it from, in the function’s init function. See
Requests and responses.
In the FastAPI, Flask, and Express runtimes, your app decides what it accepts, and the init function does not apply. See FastAPI, Flask, and Express runtimes.
Check that the call worked
Section titled “Check that the call worked”You will see the handler’s response to your request, either in the terminal for curl or in
Output for Post Request. The Invocation Count on the Info tab and in the
Monitoring chart counts each call.
If the call returns an error status, or Output says the function provided no response, see Troubleshooting Functions.