CGI and posted variables

I have a CGI application that I need to create. Its going to run on a Linux machine. Its fairly simply in that I’m going to be posting some variables to that CGI with some values, then returning some information.

I cannot for the life of me find anything to guide me in the right direction.

I see that RequestReceived is an event that I should include my code and logic, but I don’t know how to grab the posted variables and their values.
I can’t find an example, nor can I find any documentation on this.

Can someone point me in the right direction?


It sounds like you might want to look at the WebApplication.HandleSpecialURL event.

I’m trying to use a non-visual GUI… just a CGI app that I can post some variables to and do some processing on the server.

WebApplication is for WE, which would then throw a Web page up… not sure thats what I want.

I’m just trying to build a small CGI application to run and do some processing.

CGIApplication has a context, and it appears that you can get “Context HTTP.HTTPRequestContext” from the RequestReceived event when something calls that CGI… I have that part working.

My question is: Is there an example to pull the variables being posted from?

Is it coming from Context.Entity? Context.LoadVariables?

I just can’t find a damn thing about this in the documentation.

You can get the variable values using context.variable(variableName as string)
I don’t believe CGIApplication has any built in way to retrieve the names of all available variables.
To get the names of the passed variables, you’d want to add a method to the HTTPRequestContext class

Function VariableNames() As string()
dim sKeys() As String
for each key as Variant in Variables.Keys
skeys.Append key.stringValue
Return sKeys
End Function

Thanks Jim, I’ll try that.

Just to follow up. That in fact worked… thanks Jim.