---
title: "StreamingRequest class"
canonical: https://isoplane.dev/docs/reference/sdk/Isoplane.Sdk/Isoplane/StreamingRequest
---

# StreamingRequest class

An HTTP request whose body is read as a stream while it is still arriving. Declare it as the parameter of an [`HttpHandlerAttribute`](https://isoplane.dev/docs/reference/sdk/Isoplane.Sdk/Isoplane/HttpHandlerAttribute) method, in place of [`Request`](https://isoplane.dev/docs/reference/sdk/Isoplane.Sdk/Isoplane/Request), to accept uploads too large to hold in memory.

```csharp
public sealed class StreamingRequest : RequestHead
```

## Public Members

| name                                                                                                               | description                                                                                              |
| ------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------- |
| [Body](https://isoplane.dev/docs/reference/sdk/Isoplane.Sdk/Isoplane/StreamingRequest/Body) { get; }               | The request body as a read-only, forward-only stream.                                                    |
| [CanHaveBody](https://isoplane.dev/docs/reference/sdk/Isoplane.Sdk/Isoplane/StreamingRequest/CanHaveBody) { get; } | Whether the request can carry a body. It is false for a request sent without one, as a `GET` usually is. |

## Remarks

The handler can start before the body has arrived. The method, path, query, headers and cancellation token are inherited from [`RequestHead`](https://isoplane.dev/docs/reference/sdk/Isoplane.Sdk/Isoplane/RequestHead).

## Examples

```csharp
[HttpHandler]
public static async Task<Response> HandleAsync(StreamingRequest request)
{
    long length = 0;
    var buffer = new byte[64 * 1024];
    int read;
    while ((read = await request.Body.ReadAsync(buffer, request.Aborted)) != 0)
        length += read;
    return Response.Text($"Received {length} bytes");
}
```

## See Also

- class [RequestHead](https://isoplane.dev/docs/reference/sdk/Isoplane.Sdk/Isoplane/RequestHead)
- namespace [Isoplane](https://isoplane.dev/docs/reference/sdk/Isoplane.Sdk)
