WebPostFromFile

Note: This statement is only used in load test scripts. See Load Testing for more information.

Sends a POST command from a postdata file and returns the data received from a web page. If a referrer URL was specified by the WebSetReferrer statement, it is also sent with the request.

This statement uses a content type. Use the WebPost statement to post a default application/x-www-form-urlencoded content type file.

Syntax

WebPostFromFile("URL", "ContentType", "Filename")

Arguments

Argument Description
URL URL to send the request to. Only supports http and https protocols. Relative paths are automatically prepended with the %URLROOT% repository variable.
ContentType Content type of the postdata file. Valid content types depend on the web server configuration.
Filename Postdata file to post. Use a file path relative to the script or an absolute file path.

Return value

Value Description
Value Data received from the web page.

Example

result = WebPostFromFile("http://www.wysicorp.com/uploadform.php", "text/plain; charset=UTF-8", "LoginTest_1.postdata")