PhantomScript v1.7 Reference - Copyright © 2006 P1 Systems Incorporated. All Rights Reserved.

Prev | Next | Users Guide | PhantomScript Reference | P1 Systems


Networking

InternetPost

Syntax

InternetPost URL=<url> Headers=<hdrs> FormData=<keyed-values> Result=<var>

Description

Issues an HTTP POST request to a specified URL.

Parameters

URL=<url>

The URL of the POST target.

Headers=<var>

Optional. A string containing HTTP header fields to be included in the request. Header fields should be formatted just as they are to be placed in the HTTP header, including newlines.

FormData=<keyed-values>

Optional. A keyed value list containing form data element names and associated values to be passed to the web server.

Result=<var>

The variable into which the response data is to be placed. If no FormData was supplied, the HTTP response headers are returned here.

Remarks

POST is typically used to send data from forms displayed by web browsers to a web server for processing. This statement allows you to interact with a webserver that expects to receive data from an HTML form.

Example

 
Local formList

InsertKeyedValue formList "dltarget" "http://www.p1.com/Phantom15mB24.exe"
InsertKeyedValue formList "WhyAreYouDownloading" "Evaluate the product"
InsertKeyedValue formList "WhatBroughtToOurWebsite" "A friend or colleague"
InsertKeyedValue formList "WhatOperatingSystem" "Windows 2000"
InsertKeyedValue formList "EmailAddress" "me@hotmail.com"
InsertKeyedValue formList "Comments" "No"
InsertKeyedValue formList "Submit " Download "

InternetPost
URL="http://www.p1.com/P1DownloadPage.html"
FormData=formList
Result=DownloadResponse
MessageBox Text=DownloadResponse

The above script fragment emulates the P1 Systems download form and displays the HTML response in a message box.



Prev | Next | Users Guide | PhantomScript Reference | P1 Systems

PhantomScript v1.7 Reference - Copyright © 2006 P1 Systems Incorporated. All Rights Reserved.