parent
5689b89d90
commit
61f16f0278
|
@ -90,7 +90,7 @@ procedure ProcessCall(AURL: String);
|
||||||
var
|
var
|
||||||
s: String;
|
s: String;
|
||||||
{$ifdef use_fclweb}
|
{$ifdef use_fclweb}
|
||||||
stream: TStream;
|
request, response: TStream;
|
||||||
{$endif}
|
{$endif}
|
||||||
begin
|
begin
|
||||||
parser.Content := AURL;
|
parser.Content := AURL;
|
||||||
|
@ -121,12 +121,19 @@ begin
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
{$ifdef use_fclweb}
|
{$ifdef use_fclweb}
|
||||||
stream := TMemoryStream.Create;
|
response := TMemoryStream.Create;
|
||||||
|
request := nil;
|
||||||
|
|
||||||
if content.Count > 0 then
|
if content.Count > 0 then
|
||||||
content.SaveToStream(stream);
|
begin
|
||||||
|
request := TMemoryStream.Create;
|
||||||
|
content.SaveToStream(request);
|
||||||
|
request.Position := 0;
|
||||||
|
http.RequestBody := request;
|
||||||
|
end;
|
||||||
|
|
||||||
try
|
try
|
||||||
http.HTTPMethod(method, parser.Content, stream, []);
|
http.HTTPMethod(method, parser.Content, response, []);
|
||||||
except
|
except
|
||||||
on E: Exception do
|
on E: Exception do
|
||||||
begin
|
begin
|
||||||
|
@ -137,17 +144,18 @@ begin
|
||||||
end;
|
end;
|
||||||
|
|
||||||
writeln;
|
writeln;
|
||||||
writeln('Status: ', http.ResponseStatusCode);
|
writeln('Status: ', http.ResponseStatusCode, ' (', http.ResponseStatusText, ')');
|
||||||
writeln;
|
writeln;
|
||||||
writeln('Headers:');
|
writeln('Headers:');
|
||||||
for s in http.ResponseHeaders do
|
for s in http.ResponseHeaders do
|
||||||
writeln(' ', s);
|
writeln(' ', s);
|
||||||
writeln;
|
writeln;
|
||||||
stream.Position := 0;
|
response.Position := 0;
|
||||||
content.LoadFromStream(stream);
|
content.LoadFromStream(response);
|
||||||
writeln(content.Text);
|
writeln(content.Text);
|
||||||
|
|
||||||
stream.Free;
|
response.Free;
|
||||||
|
request.Free;
|
||||||
{$endif}
|
{$endif}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue