Contents · Forum Home · StreamSec Tools 4.1.5.364 documentation

methodTsmCustomHTTPSClient.BeginStreamed

function BeginStreamed(const aMethod, aURL: string; const aHeaders: tHttpHeaders; aRequestBody: TStream; aOwnsRequestBody: Boolean; aResponseBody: TStream; aOwnsResponseBody: Boolean; aMaxResponseBytes: Int64): iHttpStreamedExchange;
Starts a request whose bodies are streams - a TFileStream at either end, or both - and returns without waiting; see iHttpStreamedExchange for what happens then and for the rules about the streams. aRequestBody, when not nil, is sent from its current position to its end as the request body, with that length as Content-Length; the header rules are BeginUpload's. nil sends no body. aResponseBody, when not nil, receives the body of a 2xx response, written at its current position. aMaxResponseBytes bounds what is written to it (0: no bound; the stream is yours to fill) and takes the place of Limits.BodyBytes for that body, so a response of any size can be stored, on HTTP/1.1, HTTP/2 and HTTP/3 alike. nil keeps the response in memory as BeginRequest does. The aOwns arguments hand the stream to the exchange, which frees it. IF THIS CALL RAISES, BOTH STREAMS ARE STILL YOURS, owned or not. Nothing is followed or resent: a redirect is simply the response.