[Yandex Cloud documentation](../../index.md) > [Yandex Serverless Containers](../index.md) > [Concepts](index.md) > Invoking a container

# Invoking a container in Serverless Containers

You can invoke a container:
* Over [HTTPS](#https).
* Using a [trigger](#trigger).
* Using a [Yandex API Gateway extension](#extension).

When invoking a container, its [active revision](container.md#revision) is used.

The process which starts when invoking a container depends on the [container operation mode](container.md#runtime).

Container invocation ends in one of the following cases:

* Serverless Containers processed an HTTP request within the specified timeout and returned an HTTP response consistent with the [container operation mode](container.md#runtime). The timeout includes the time spent starting the container instance.
* Serverless Containers failed to process an HTTP request within the specified timeout and returned a 504 error.
* There is an infrastructure or initialization error with details provided in the response body.

## HTTPS {#https}

{% note info %}

Container calls may be restricted by [access policies](../../iam/concepts/access-control/access-policies.md#supported-policies).

{% endnote %}

When calling a container over HTTPS, an HTTP request is passed to the application deployed in the container.

### Filtering message headers {#filter}

When being passed to the container, some HTTP request and response headers change, as described below.

{% list tabs %}

- Request headers {#request-headers}
    
    Removed from a request:

    - "Expect"
    - "Te"
    - "Trailer"
    - "Upgrade"
    - "Proxy-Authenticate"
    - "Authorization"
    - "Connection"        
    - "Content-Md5"       
    - "Max-Forwards"
    - "Server"
    - "Transfer-Encoding"
    - "Www-Authenticate"
    - "Cookie"

- Response headers {#response-headers}
        
    - Removed from a response:
        - "Host"
        - "Authorization"
        - "User-Agent"
        - "Connection"
        - "Max-Forwards"
        - "Cookie"
        - "X-Request-Id"
        - "X-Function-Id"
        - "X-Function-Version-Id"
        - "X-Content-Type-Options"
    
    - Cause an error if present in a response:
    
        - "Proxy-Authenticate"
        - "Transfer-Encoding"
        - "Via"
    
    - Overwritten by adding the `X-Yf-Remapped-` prefix:
        - "Content-Md5"
        - "Date"
        - "Server"
        - "Www-Authenticate"

{% endlist %}

### IP address of the request source {#ip}

If a request contains the [X-Forwarded-For](https://en.wikipedia.org/wiki/X-Forwarded-For) header, it includes the specified IP addresses and the IP address of the user who invoked the container. If this header is missing, the request only provides the IP address of the user who invoked the container.

## Triggers {#trigger}

When invoking a container using a trigger, an HTTP POST request is sent to the [address the container is invoked at](../operations/invocation-link.md). The request body contains a JSON description of the trigger event. The request source IP is provided in the same way as when [invoking a container using HTTPS](#ip). Learn more about [triggers](trigger/index.md).

## Yandex API Gateway extension {#extension}

When invoking a container using the API Gateway, the container is handed over an HTTP request addressed to the API gateway. In which case the `Host` header specifies the host used by the user to access the API gateway, not the container's host. The request source IP is provided in the same way as when [invoking a container using HTTPS](#ip). Learn more about the extension in the [Yandex API Gateway documentation](../../api-gateway/concepts/extensions/containers.md).

## Use cases {#examples}

* [Developing CRUD APIs for a movie service](../tutorials/movies-database.md)
* [Setting up a Yandex Managed Service for PostgreSQL connection from a container in Serverless Containers](../tutorials/pg-connect.md)
* [Developing functions in Functions Framework and deploying them to Yandex Serverless Containers](../tutorials/functions-framework-to-container.md)