AddPostVariable

From SCAR Divi Manual
Revision as of 11:26, 3 July 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> procedure AddPostVariable(const iHttp: Integer; const VarName, VarValue: AnsiString); </source> ==Availability== SCAR Divi 3.00...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Definition

procedure AddPostVariable(const iHttp: Integer; const VarName, VarValue: AnsiString);

Availability

SCAR Divi 3.00 > Current

Description

Adds a post variable to an HTTP connection specified by iHttp defined by the name VarName with the value VarValue. The post variables can be cleared with ClearPostData.

Example

var
  i: Integer;

begin
  i := InitializeHTTPClient(True, True);
  try
    AddPostVariable(i, 'post1', 'Hello');
    AddPostVariable(i, 'post2', 'World!');
    WriteLn(PostHTTPPageEx(i, 'http://doc.scar-divi.com/post.php'));
    ClearPostData(i);
    AddPostVariable(i, 'newpost', 'Hi');
    WriteLn(PostHTTPPageEx(i, 'http://doc.scar-divi.com/post.php'));
  finally
    FreeHTTPClient(i);
  end;
end.

Output:

---POST variables---
Name: post1; Value: Hello
Name: post2; Value: World!
---POST variables---
Name: newpost; Value: Hi

See Also