KtorImmutableHttpRequest
Immutable HTTP request wrapper for Ktor requests.
This class provides a read-only view of an already-dispatched Ktor HTTP request. It implements the HttpRequest interface but all mutation operations are no-ops since the underlying request has already been sent and cannot be modified.
Purpose
This wrapper is primarily used in response interceptors where you need to inspect the original request that generated a response, but should not be able to modify it. It provides safe access to request metadata like URL, method, and headers without allowing changes to the completed request.
Immutability
All setter and mutation methods (parameter, header, cookies, post, form, put, delete) are implemented as no-ops and will silently ignore any attempted modifications. Only getter methods (url, method, header) return actual values.
Thread Safety
This class is thread-safe for read operations as it wraps an immutable Ktor request that has already been dispatched.
See also
For mutable request building.
For the corresponding response wrapper.