jwtHeaderAddJSON (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

All

Firmware version:

1.70.00


jwtHeaderAddJSON adds headers from the provided JSON encoded string to the JWT object.

It will overwrite existing headers.

 

Input:

jwt : SYSHANDLE

A handle to the JWT object.

 

value : STRING

The JSON encoded string with the headers to add.

 

 

 

Returns: INT

1

- Success

0

- Function is not supported.

-1

- Invalid name.

-2

- Could not find JWT object.

-6

- Header already exists.

-99

- Failed to add header.

 

 

Declaration:

FUNCTION jwtHeaderAddJSON : INT;
VAR_INPUT
  jwt   : SYSHANDLE;
  value : STRING;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
VAR
  rc  : INT;
  jwt : SYSHANDLE;
END_VAR;
 
BEGIN
  ...
  // Add header
  rc := jwtHeaderAddJSON(jwt := jwt, value := "{$"map$@:{$"a$":47,$"b$":5}}");
  ...
END;
 
END_PROGRAM;