---
title: RequestHelper
summary: API reference for RequestHelper.
status: draft
owner: SAIF IT Core Services
last_reviewed: 2026-10-12
library: BolMiddleware
reference_type: package
---

# RequestHelper

Implementation of `IRequestHelper` constructed by `BolContextModel` over the current `HttpRequest`. It prefers form values over query values for the context id.

## Purpose
- Read the context id (form `WebContextId`, otherwise query `cid`) and session values for context resolution ([BR-BOLMIDDLEWARE-001](../../business-rules.md#br-bolmiddleware-001-web-context-resolution-precedence)).

## Context
- Namespace: `BolMiddleware.Services.Request`
- Assembly/package: `BolMiddleware`

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| Constructor | `RequestHelper(HttpRequest request)` | Binds the helper to one request. |
| `GetReferringApplication` | `string? GetReferringApplication()` | Reads the referring application value. |
| `GetContextId` | `string? GetContextId()` | Form value first, query value second. |
| `GetSessionId` | `string? GetSessionId()` | Returns the session id. |
| `GetFormValue` | `string? GetFormValue(string key)` | Reads a form value, or null when absent. |
| `GetContextFromSession` | `ContextResult? GetContextFromSession()` | Reads the context from session. |
| `GetSession` | `ISession GetSession()` | Returns the session of the request. |

## Behavioral notes
- Context ids are accepted without checking who owns them.

## Constraints and usage notes
- Reading the form on a request without form content may throw.

## Sources
- src/BolMiddleware/Services/Request/RequestHelper.cs
