Difference between revisions of "PostHTTPPageEx"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function PostHTTPPage(const iHttp: Integer; const Url: AnsiString; const PostData: AnsiString): AnsiString; </source> ==Availab...")
 
 
(2 intermediate revisions by the same user not shown)
Line 8: Line 8:
  
 
==Description==
 
==Description==
Gets the content of a webpage specified by '''Url''' from an open HTTP connection specified by '''iHttp''' while sending a set of post variables defined by [[AddPostVariable]].
+
Gets the content of a webpage specified by '''Url''' from an open HTTP connection specified by '''iHttp''' while sending a set of post variables assigned to the connection by [[AddPostVariable]].
  
 
==Example==
 
==Example==
Line 20: Line 20:
 
     AddPostVariable(i, 'post1', 'Hello');
 
     AddPostVariable(i, 'post1', 'Hello');
 
     AddPostVariable(i, 'post2', 'World!');
 
     AddPostVariable(i, 'post2', 'World!');
     WriteLn(PostHTTPPageEx(i, 'http://services.scar-divi.com/doc/post.php'));
+
     WriteLn(PostHTTPPageEx(i, 'http://doc.scar-divi.com/post.php'));
 
     ClearPostData(i);
 
     ClearPostData(i);
 
     AddPostVariable(i, 'newpost', 'Hi');
 
     AddPostVariable(i, 'newpost', 'Hi');
     WriteLn(PostHTTPPageEx(i, 'http://services.scar-divi.com/doc/post.php'));
+
     WriteLn(PostHTTPPageEx(i, 'http://doc.scar-divi.com/post.php'));
 
   finally
 
   finally
 
     FreeHTTPClient(i);
 
     FreeHTTPClient(i);
Line 46: Line 46:
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Internet Functions]]
 
[[Category:Internet Functions]]
 +
[[Category:HTTP Functions]]

Latest revision as of 09:56, 4 July 2011

Definition

function PostHTTPPage(const iHttp: Integer; const Url: AnsiString; const PostData: AnsiString): AnsiString;

Availability

SCAR Divi 3.00 > Current

Description

Gets the content of a webpage specified by Url from an open HTTP connection specified by iHttp while sending a set of post variables assigned to the connection by AddPostVariable.

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