All Products
Search
Document Center

Function Compute:Python HTTP functions

Last Updated:Apr 01, 2026

A handler is the method in your function code that Function Compute (FC) calls to process requests. Configure a handler to connect your Python code to the FC runtime so your function can receive and respond to invocations.

How handlers work

When FC invokes a Python function, it calls the handler method you specify. The handler receives the incoming request, runs your logic, and returns a response.

Handler naming

For Python functions, set the Request Handler parameter to <filename>.<method_name>.

ComponentDescriptionExample
filenamePython file name without the .py extensionmain
method_nameFunction name inside the filehandler

For example, if your file is main.py and your method is handler, set Request Handler to main.handler.

To update the handler in the console:

  1. Go to the Function Compute console and open your function.

  2. Find the Request Handler field.

  3. Enter the handler in filename.method_name format, then save.

Handler types

FC supports two handler types. Choose based on how your function is triggered.

Handler typeTriggered byUse when
Event handlerEvent sourcesBuilding event-driven workflows
HTTP handlerHTTP triggersBuilding web APIs or handling HTTP requests directly

The handler signature differs between the two types. For structure details and examples, see:

For background on event functions and HTTP functions, see Function types.

What's next