The function kcHttpGetHeaderByName
returns the value of an HTTP header field which is specified by its name. The header field Authorization
can not be read.
This function may be called both in program unit and HTTP exit program.
In the program unit the function may only called in the first program unit run of a service.
kc_http_retcode kcHttpGetHeaderByName( char * headerName, char * headerValue, int * headerValueLth );
This function has following function parameter:
>> | headerName | The name of the HTTP header field to be read. |
<< | headerValue | The pointer to a buffer in which the value of the HTTP header field is returned. The length of the buffer must be at least headerValueLth bytes. |
<> | headerValueLth | The pointer to a variable in which the length of the buffer for the value of the HTTP header is passed and the actual length of the value is returned. |
Description of returned value of function call:
KC_HTTP_OK
The function has successfully terminated.
KC_HTTP_FUNCTION_CALL_NOT_ALLOWED
The function was called by the KDCS program unit before the KDCS call INIT was executed or not in the first program unit run or outside an HTTP exit program.
KC_HTTP_NO_HTTP_CLIENT
The calling service was not initiated by an HTTP client.
KC_HTTP_HEADER_NAME_NULL_OR_EMPTY
The pointer to the header name headerName
is NULL or the name is empty.
KC_HTTP_PARAM_VALUE_NULL
The pointer to the buffer for the header value headerValue
or the pointer to the length of the header value headerValueLth
is NULL.
KC_HTTP_INVALID_LENGTH
The value of the length of header value headerValueLth
is lower or equal 0.
KC_HTTP_HEADER_NOT_FOUND
There is no HTTP header with the name specified in headerName
.
KC_HTTP_RESULT_TRUNCATED
The length of the buffer for the header value is less than the actual length of the value. The header value is truncated and the actual length is returned.