Contents · Forum Home · StreamSec Tools 4.1.5.363 documentation

methodiHttpServerExchange.Read

function Read(var aBuffer: TBytes; aOffset, aCount: Integer; out aRead: Integer): tHttpServerReadResult;
Copies up to aCount body bytes into aBuffer[aOffset..] without waiting; aRead is how many, 0 unless the answer is hsrrData. hsrrData: use them and read again. hsrrPending: nothing yet - WaitForBody, then read again. hsrrComplete: the whole body has arrived and passed the wire's checks; Trailers is final and TryComplete can succeed. hsrrFailed: failed, cancelled or rejected - never treat it as the end of the body. Nothing read is final before hsrrComplete: a later framing or trailer error can still fail the request, so commit side effects only then. aBuffer must already be allocated; a range outside it raises eHttpArgumentError.