G Web Server Examples

CGI Call with Single Parameter (GET)

When a CGI is invoked, you can pass query string as part of the URL that invokes the CGI. The query string consists of everything that follows a question mark (?) in the URL. Parameters must be encoded according to HTTP rules, in particular, an encoded character is replaced with the string %xx where xx is the hexadecimal value of the encoded character.

The following links call the CGI /cgi-bin/examples/cgi_cgl.vi which simply generates an HTML document with the contents of the parameter.

/cgi-bin/examples/cgi_sgl.vi
This call does not contain query information.

/cgi-bin/examples/get_sgl.vi?query_parameter
This call contains the query string query_parameter.

/cgi-bin/examples/get_sgl.vi?hello%20world
This call contains the query string hello%20world. The %20 is an encoded space character.


© National Instruments