Loading...
 

CX_HTTP_REQUEST::GetParameter

CX_HTTP_REQUEST::GetParameter

Description:

Returns the value of a specific query or body parameter of the HTTP request. The names of the set parameters can be queried with GetParameterNames. If an HTTP request contains a body parameter and a query parameter with the same name, the value of the query parameter is returned, since the query parameters are prioritised.

Code example:

The following GET request

GET /call_person?name=Schmidt&vorname=Hugo HTTP/1.1
Host: classix.de

leads to the following source code being executed in ClassiX

CALL_PERSON_GET: "name" Swap Call(GetParameter) Attention

and then a MessageBox with the following content would open:

Schmidt
Code example:
Var(req) CreateTransObject(CX_HTTP_REQUEST) -> req /?name=jimmy&age=13" req Call(SetURL) "name" "john" req Call(SetParameter) //Query parameter name=jimmy has precedence "name" req Call(GetParameter) //-> STRING("jimmy") "age" req Call(GetParameter) //-> STRING("13") //Removing it, makes the body parameter accessible "name" "" req Call(SetQueryParameter) "name" req Call(GetParameter) //-> STRING("john")

Stack

Stack Position Object type Brief description
Stack(In) Top CX_HTTP_REQUEST The http request whose parameter value is to be returned
Stack(In) Top 1 STRING The name of the parameter
Stack(Out) Top STRING The value of the parameter
Function call: Call(GetParameter)