Instance Method
string(max:)
The body decoded as UTF-8, collecting the stream first if nothing has collected it yet.
func string(max: BodySizeLimit = .default) async throws -> String?
Parameters
maxThe ceiling, as
collect(max:).
Return Value
The body decoded as UTF-8, or nil if the request has no body.
Discussion
The collecting counterpart to string. See data(max:) for the semantics; this decodes the result, substituting U+FFFD for any invalid UTF-8 rather than failing.
Throws
Abort with .contentTooLarge if the body exceeds max.