restRespHeaderGet (Function)

Top  Previous  Next

Architecture:

NX32L

Device support:

ALL

Firmware version:

2.10.00


This function will read a header field from a response.

 

Input:

resp : SYSHANDLE

A handle to the response.

 

name : STRING

The name of the header field to read.

Common fields include "Content-Type", "Accept" and "User-Agent".

 

check_case : BOOL (Default FALSE)

If set to TRUE, the name will use case sensitive comparison.

If left at FALSE, the name will use case insensitive comparison.

Note that if the same name is present with different case, only the value for the first matching name will be returned.

 

 

Output:

value : STRING

The value of the field.

 

 

Returns: INT

1


- Success

0


- Not supported

-1


- Invalid response

-2


- The header was not found

-7


- The value was too large for a string.

 

Declaration:

FUNCTION restRespHeaderGet : INT;
VAR_INPUT
  resp           : SYSHANDLE;
  name           : STRING;
  check_case     : BOOL := FALSE;
  value          : ACCESS STRING;
END_VAR;

 

 

Example:

Please see the "Examples - REST Basic Authentication Example"