InternetPostRequest
- send HTTP Post request to Internet web resource (URL)

File Input/Output functions
(AmiBroker 6.30)


SYNTAX InternetPostRequest(''http://url_to_your_web_resource'', data, flags = 0)
RETURNS HANDLE
FUNCTION The function sends URL-encoded data via HTTP Post request to the specified URL and returns a special file handle to be used by InternetReadString/InternetClose functions. It allows to open any web page or REST API service
EXAMPLE ih = InternetPostRequest( "http://server_name_here.com/testpost.php?param3=7&m4=8", /*POST DATA*/ "param1=9&m2=12" );

if( ih )
{
    while( ( str = InternetReadString( ih ) ) != "" )
    {
       printf( "%s", str );
    }
    
    InternetClose( ih );
}


// testing code (server side ) in PHP:


echo "Post variables: \r\n";

foreach ($_POST as $key => $value){
   echo "{$key} = {$value} \r\n";
}

echo "Get variables: \r\n";

foreach ($_GET as $key => $value){
   echo "{$key} = {$value} \r\n";
}

?>
SEE ALSO InternetOpenURL() function , InternetClose() function , InternetReadString() function

References:

The InternetPostRequest function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.