* Added variable support for POST content

This commit is contained in:
Andreas Schneider 2015-09-17 16:20:13 +02:00
parent 3665c0a6b5
commit 4f048a3d02
1 changed files with 18 additions and 4 deletions

View File

@ -98,13 +98,21 @@ var
begin
parser.Content := AURL;
parser.Replace;
writeln('Calling ', parser.Content);
AURL := parser.Content;
writeln('Calling ', AURL);
{$ifdef use_synapse}
if content.Count > 0 then
content.SaveToStream(http.Document);
begin
// Variable replacement
parser.Content := content.Text;
parser.Replace;
content.Text .= parser.Content;
if http.HTTPMethod(method, parser.Content) then
content.SaveToStream(http.Document);
end;
if http.HTTPMethod(method, AURL) then
begin
writeln;
writeln('Status: ', http.ResultCode);
@ -130,13 +138,19 @@ begin
if content.Count > 0 then
begin
request := TMemoryStream.Create;
// Variable replacement
parser.Content := content.Text;
parser.Replace;
content.Text := parser.Content;
content.SaveToStream(request);
request.Position := 0;
http.RequestBody := request;
end;
try
http.HTTPMethod(method, parser.Content, response, []);
http.HTTPMethod(method, AURL, response, []);
except
on E: Exception do
begin