restRespBodySetString (Function)

Top  Previous  Next

Architecture:

NX32L

Firmware version:

2.10.00


This function will set the body content of the response to the provided string.

 

When the body needs to contain mostly fixed data, one option is to use strTemplateCreate to add the dynamic data to a fixed template string, which can then be used as the body, without needing to manually create the entire string.

 

Input:

resp : SYSHANDLE

A handle to the response.

 

str : STRING

The string to use for the body content.

 

 

Returns: INT

1


- Success

0


- Not supported

-1


- Invalid response

-3


- Failed to set body

 

Declaration:

FUNCTION restRespBodySetString: INT;
VAR_INPUT
   resp           : SYSHANDLE;
   str            : STRING;
END_VAR;

 

 

Example:

Please see the "Examples - REST Example"