Defines a single-valued variable for an HTTP-based statement.

An HTTP single-valued variable declares a variable which accepts a unique value to an HTTP-based statement.
This variable is dedicated to HTTP-based statements only:

HTTP request statement.

This variable object allows defining an HTTP request parameter through the HTTP name and HTTP method properties.
It can define a default value, specified in the Default value property, that is used as HTTP parameter value if no value is found for this variable.
At runtime, the HTTP parameter value is calculated by Convertigo through the following steps:

• if a variable of the same name exists in the JavaScript scope of current context, the JavaScript value of the variable is chosen,
• if no JavaScript variable is defined, the context value of the variable is chosen, if a variable of the same name is stored in current context,
• if none of the previous methods gives a value, the default value defined in Default value property is used,
• if no default value is specified, the variable is not sent in the HTTP request.

Note: In Convertigo Studio, when an HTTP single-valued variable is created in an HTTP request statement, it can be easily replaced by an HTTP multi-valued variable, using the right-click menu on the variable and choosing the option Change to > MultiValued variable.

Property Type Category Description
Comment String standard Describes the object comment to include in the documentation report.
This property generally contains an explanation about the object.
Default value Object standard Defines the variable’s default value(s).
This property allows defining a default value or default list of values to use when no variable value is provided to the parent transaction (or sequence).
A variable is always created with a default value set to null, which means that the variable is only declared and has no default value.
At run time, Convertigo looks for the variable among the query parameters, the JavaScript scope or the objects in the context to retrieve its value. If the variable is found, its value is used, if not found, the default value specified by this property is used.
In this last case, and if the default value of the variable is not set (Default value property set to null), an exception can be thrown by any object or JavaScript code trying to use the undefined variable.
It is up to the Convertigo developer to unset the variable’s null value, i.e. to set a default value to the variable. He should prefer using a Test Case to test specific values for the variable or pass a variable value directly when invoking the transaction (or sequence).
Note: To unset the null value of the property, click on the cross-shaped button in the field. Then, the default value is an empty string. You can use it as is or add a value.
Description String standard Describes the variable.
This property is used to describe the variable in the widget generated from its parent transaction (or sequence) in Convertigo Mashup Composer.
HTTP method String standard Defines the HTTP method to use for this variable.
This property allows choosing which HTTP method has to be used to send the variable in the HTTP request. The following values are available:

GET: the variable is added to the query string as follows: ?<initial_query_string>&<variable_name>=<variable_value>.
POST: the variable is added to the post data sent in the HTTP request as a standard POST FORM.

GET and POST method variables can be mixed in a same statement. If at least one POST variable is used, the statement’s HTTP verb is overridden to POST by Convertigo.
HTTP name String standard Defines the HTTP parameter name.
This property allows defining the name of the HTTP parameter sent in the request by Convertigo executing the statement. An empty value use the variable name. The HTTP parameter named by this property is added to the query string or to post data, depending on the HTTP method property value.
If the HTTP-based statement emulates a form submission, this property can match the name attribute of an HTML input field. If the HTTP-based statement emulates a resource access by URL, this property can match one of the variables names from the query string (between “&” and “=” characters).
Visibility int standard Defines the variable’s visibility.
This property allows defining whether the variable’s value is masked or not in:

log files: selecting this option will mask the variable’s value that may be printed in all loggers,
studio user interface: selecting this option will mask the variable’s value in the Properties view from the Studio, as well as in the tree of the Projects view,
platform user interface: selecting this option will mask the variable’s value in the test platform of the project and when editing the project in Convertigo web administration,
project's XML files: selecting this option will mask the variable’s value in the project’s XML files generated on the file system when saving the objects from the project.

Any combination of these options can be chosen, it allows to customize precisely the variable’s value display. A last option is available: Mask value in all. Selecting this option will mask the variable’s value in all previously described cases.
isRequired Boolean standard Defines whether the variable is required.