---
title: "Incoming request"
description: "Understand how to interpret an incoming request."
url: https://docs.icerpc.dev/icerpc/dispatch/incoming-request
docs_index: https://docs.icerpc.dev/llms.txt
---

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

# Incoming request

Understand how to interpret an incoming request.

## Receiving an incoming request

The dispatch method of a [dispatcher](https://docs.icerpc.dev/icerpc/dispatch/dispatch-pipeline.md#the-dispatcher-abstraction) accepts an incoming request. This incoming request is created by the connection when it receives a request from the peer.

An incoming request holds:

- the path of the target service
- the name of the operation on this service
- request [fields](https://docs.icerpc.dev/icerpc/invocation/outgoing-request.md#request-fields)
- the [payload](#request-payload) of the request

An incoming request also holds [features](#request-features). These features are used for local communications within this dispatch pipeline; they are also used for communications between dispatchers in the pipeline and your application code.

## Request payload

The payload of an incoming request is a stream of bytes that represents the argument(s) of an operation. As far as IceRPC is concerned, the number of bytes in this stream is unknown.

## Request features

It is common for the dispatchers in a dispatch pipeline to transmit information to each other during a dispatch. In C#, these dispatchers get and set the request's [IFeatureCollection](https://code.icerpc.dev/csharp/0.7.x/api/reference/IceRpc.Features.IFeatureCollection.html) for these communications.

You can also use these features to communicate with your service code. For example, if you install the dispatch information middleware, it sets the [IDispatchInformationFeature](https://code.icerpc.dev/csharp/0.7.x/api/reference/IceRpc.Features.IDispatchInformationFeature.html) and you can retrieve this feature in your code:

```csharp
// In Slice service implementation
public ValueTask OpAsync(string message, IFeatureCollection features, CancellationToken cancellationToken)
{
    if (features.Get<IDispatchInformationFeature>() is IDispatchInformationFeature dispatchInformation)
    {
        EndPoint from = dispatchInformation.ConnectionContext.TransportConnectionInformation.RemoteNetworkAddress;
        Console.WriteLine($"dispatching request from {from}");
    }
    Console.WriteLine(message);
    return default;
}
```

By convention, the features are keyed using interface types, such as `IDispatchInformationFeature` in the example above.

> **Note**
>
> Fields are used for communications "over the wire" while features are used for local communications within a dispatch pipeline. IceRPC provides both request fields (carried by requests) and response fields (carried by responses), but only request features: since it's all local, there is no need for response features.
