WebPageForm Function

Action

Posts the content of a Web form to the Web server by means of the HTTP POST method. If the form includes a random variable, this function selects a new random value each time the form is posted. If the retrieved document is of content type HTML, it is parsed and embedded documents are retrieved.

Include file

WebAPI.bdh

Syntax

WebPageForm(
  in sUrl : string,
  in formBody : form,
  in sTimer : string optional,
  in formUrl : form optional): boolean;

Return value

  • true if the page is downloaded successfully

  • false otherwise

Parameter Description
sUrl Absolute URL to the document on the server. All characters that are part of the query string are not URL-encoded.
formBody Form identifier used in the dclform section. The expanded form is added to the body of the request. The Content-Length and Content-Type header are added automatically. The default Content-Type is application/x-www-form-urlencoded and can be overwritten by a WebHeaderAdd("Content-Type", "myEncoding") function call prior to the WebPageForm function call.
sTimer Name of the timer used for page measurements (optional). If this parameter is omitted, no measurements are performed.
formUrl Form identifier used in the dclform section (optional). The expanded form string is appended to the URL after the "?". All unsafe characters are URL-encoded.

Example

dcltrans
  transaction TMain
  begin
    WebPageForm("http://lab3/shopit/kindofpayment.asp", SUBMIT001,
"ShopIt - Pay with credit card");
  end TMain;
dclform
  SUBMIT001:
    "choice" := "Credit card",
    "paymentButton" := "Submit";