--- title: "Call a function" description: "Call a Functions function over its HTTPS URL with curl or from MyAccount with Post Request, and what the default CORS and body rules mean." content_type: "how-to" product: "functions" platform: "MyAccount" url: "/myaccount/functions/how-to/call-a-function/" topic: ["call"] relationships: {"requires":["/myaccount/functions/how-to/create-a-function/"]} --- # Call a function 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://-.serverless.e2enetworks.net/`. `` is the name you gave the function. The suffix is the same for every function in your account. ## 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 A GET request returns the function's response: ```bash curl https://-.serverless.e2enetworks.net/ ``` A POST request with a JSON body does the same: ```bash curl -X POST -H "Content-Type: application/json" -d '{"key": "value"}' \ https://-.serverless.e2enetworks.net/ ``` Replace the address with your function's **URL**. The response is whatever the handler returns. ## Call the function from MyAccount 1. In **Compute > Functions**, click the function's name to open its page. 2. Click **Try**. The **Enter Arguments** panel opens. 3. In **User Input**, enter the JSON arguments for the call. 4. Click **Post Request**. The response shows in **Output**, with **Runtime Logs** beside it. ## 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](/myaccount/functions/concepts/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](/myaccount/functions/concepts/requests-and-responses/#fastapi-flask-and-express-runtimes). ## 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](/myaccount/functions/troubleshooting/functions/).