# WGETVAR

Updated: 4/3/2020, 10:08:01 PM
Created: 4/3/2020, 10:08:01 PM
Last Updated By: Mike Street
Read Time: 1 minute(s)

Created At: 6/24/2017 12:56:05 AM
Updated At: 11/24/2017 6:46:57 PM
Original Doc: wgetvar
Original ID: 260978
Internal: No

The WGETVAR subroutine allows you to retrieve variables sent in the web request.

# COMMAND SYNTAX

CALL WGETVAR(VARVALUE,VARNAME)
1

# SYNTAX ELEMENTS

Parameter Description
VARVALUE This is the returned value of the variable.
VARNAME This is a passed in parameter of the value you want retrieved.

# EXAMPLE

CALL WGETVAR(VAR1,"var1")
1

# NOTES

Only variables sent on the url bar or via x-www-form-urlencoded posts.  Form-Data encoding is not supported. Below is an example from POSTMAN

wgetvar: blob

You can get a list of all supplied variables by call the WGETINFO subroutine and pass it 25.

CALL WGETINFO(VARS, 25)
NUM.VARS=DCOUNT(VARS,@AM)
FOR V=1 TO NUM.VARS
   VAR.NAME=VARS<V>
   CALL WGETVAR(VAR.VALUE,VAR.NAME)
   PRINT VAR.NAME:" = ":VAR.VALUE
NEXT V
1
2
3
4
5
6
7