---
title: "Request Contexts"
url: https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts
language: cpp
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# Request Contexts

Programming language: C++. Other languages: [C#](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts/csharp.md), [Java](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts/java.md), [JavaScript](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts/js.md), [MATLAB](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts/matlab.md), [PHP](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts/php.md), [Python](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts/python.md), [Ruby](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts/ruby.md), [Swift](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts/swift.md).

A *request context* is a dictionary of string keys and values that Ice sends with an invocation. It lets a client send additional information with a request without adding a parameter to the operation. The implementation of the operation reads the context from the `ctx` field of its `Current` parameter.

A [middleware](https://docs.zeroc.com/ice/3.8/runtime/dispatch/middleware/cpp.md) is a typical consumer of request contexts: it sees every request the object adapter dispatches and reads the context through the `current` of the incoming request.

A client supplies a context in the following ways:

- An [explicit context](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts/explicit-request-contexts/cpp.md) applies to one invocation.
- A [per-proxy context](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts/per-proxy-request-contexts/cpp.md) applies to the invocations made through a proxy.
- An [implicit context](https://docs.zeroc.com/ice/3.8/runtime/invocation/request-contexts/implicit-request-contexts/cpp.md) applies to the invocations made through the proxies of a communicator.

Context keys that begin with an underscore are reserved for Ice.

## Combining Request Contexts

An explicit context, even an empty one, replaces the other contexts: Ice sends only the explicit context with the invocation.

Without an explicit context, Ice sends the entries of both the per-proxy and the implicit contexts. When both contain the same key, Ice sends the value of the per-proxy context.
