|
@@ -50,6 +50,7 @@ Type
|
|
Protected
|
|
Protected
|
|
function GetHeaders: TStrings;virtual;
|
|
function GetHeaders: TStrings;virtual;
|
|
function GetStream: TStream;virtual;
|
|
function GetStream: TStream;virtual;
|
|
|
|
+ procedure SetStream(aValue : TStream); virtual;
|
|
property IsAsync : Boolean read FIsAsync;
|
|
property IsAsync : Boolean read FIsAsync;
|
|
Public
|
|
Public
|
|
constructor create(aASync : Boolean; const aRequestID : String = '');
|
|
constructor create(aASync : Boolean; const aRequestID : String = '');
|
|
@@ -61,7 +62,9 @@ Type
|
|
// Request headers or response headers
|
|
// Request headers or response headers
|
|
Property Headers : TStrings Read GetHeaders;
|
|
Property Headers : TStrings Read GetHeaders;
|
|
// Request content or response content
|
|
// Request content or response content
|
|
- Property Content: TStream Read GetStream;
|
|
|
|
|
|
+ Property Content: TStream Read GetStream Write SetStream;
|
|
|
|
+ // Request/Response own the stream, i.e. free the stream when destroyed.
|
|
|
|
+ Property OwnsStream : Boolean Read FOwnsStream Write FOwnsStream;
|
|
// SSLVersion : Which version to use
|
|
// SSLVersion : Which version to use
|
|
Property SSLVersion : TSSLVersion Read FSSLVersion Write FSSLVersion;
|
|
Property SSLVersion : TSSLVersion Read FSSLVersion Write FSSLVersion;
|
|
end;
|
|
end;
|
|
@@ -504,6 +507,15 @@ begin
|
|
Result:=FStream;
|
|
Result:=FStream;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TRequestResponse.SetStream(aValue : TStream);
|
|
|
|
+begin
|
|
|
|
+ if aValue=FStream then
|
|
|
|
+ exit;
|
|
|
|
+ if FOwnsStream then
|
|
|
|
+ FreeAndNil(FStream);
|
|
|
|
+ FStream:=aValue;
|
|
|
|
+end;
|
|
|
|
+
|
|
constructor TRequestResponse.Create(aAsync: Boolean; const aRequestID : String);
|
|
constructor TRequestResponse.Create(aAsync: Boolean; const aRequestID : String);
|
|
|
|
|
|
begin
|
|
begin
|