restReqPostSet (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

2.10.00


This function will set the value of a post parameter in a request.

If the request contains post parameters, it can not also contain a normal body, as set with restReqBodySetJSON or restReqBodySetString.

 

Input:

req : SYSHANDLE

A handle to the request.

 

name : STRING

The name of the post parameter to set.

 

value : STRING

The new value of the parameter.

 

 

Returns: INT

1


- Success

0


- Not supported

-1


- Invalid request

-3


- Failed to set query

-5


- Request is read only.

 

Declaration:

FUNCTION restReqPostSet: INT;
VAR_INPUT
   req            : SYSHANDLE;
   name           : STRING;
   value          : STRING;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM example;
VAR
   rc        : INT;
   req       : SYSHANDLE;
END_VAR
BEGIN
   ...
 
   // Set post parameter "post1" to "Value"
   rc := restReqPostSet(req:=reqname:="post1", value:="Value");
   DebugFmt(message:="restReqPostSet: \1", v1:=rc);
   ...
END;
END_PROGRAM;