Difference between revisions of "PostHTTPPage"
From SCAR Divi Manual
(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 ''' | + | Gets the content of a webpage specified by '''Url''' from an open HTTP connection specified by '''iHttp''' while sending a set of post variables given by the [[AnsiString|string]] '''PostData'''. '''PostData''' is structured as "var1=val1&var2=val2&...&varn=valn". An extended function with additional functionality is available as [[PostHTTPPageEx]]. |
==Example== | ==Example== | ||
Line 18: | Line 18: | ||
i := InitializeHTTPClient(True, True); | i := InitializeHTTPClient(True, True); | ||
try | try | ||
− | WriteLn(PostHTTPPage(i, 'http:// | + | WriteLn(PostHTTPPage(i, 'http://doc.scar-divi.com/post.php', |
'post1=Hello&post2=World!')); | 'post1=Hello&post2=World!')); | ||
finally | finally | ||
Line 38: | Line 38: | ||
[[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 given by the string PostData. PostData is structured as "var1=val1&var2=val2&...&varn=valn". An extended function with additional functionality is available as PostHTTPPageEx.
Example
var i: Integer; begin i := InitializeHTTPClient(True, True); try WriteLn(PostHTTPPage(i, 'http://doc.scar-divi.com/post.php', 'post1=Hello&post2=World!')); finally FreeHTTPClient(i); end; end.
Output:
---POST variables--- Name: post1; Value: Hello Name: post2; Value: World!