This hook function, if defined, is called by μC/HTTP-server before starting to transmit the response message as shown on Hook Functions. It allows the upper application to add header field to the response by calling a specific API function with header field type and value.
Prototype
Arguments
p_instance
Pointer to the instance structure (read only).
p_conn
Pointer to the connection structure (read only).
p_hook_cfg
Pointer to hook application data.
Return Value
DEF_YES
If all header fields are added without error.
DEF_NO
otherwise.
Required Configuration
HTTPs_CFG_HDR_EN
must be enabled in the http-s_cfg.h file (see section Module Configuration).
The header feature must also be enabled in the Instance configuration (see section Instance Parameters Configuration).
See section Hook Configuration.
Notes / Warnings
- The instance structure is for read-only. It must not be modified.
- Connection structure must not be modified by this function since the response is mostly ready to be transmitted.
Example Template
The listing below is shown to demonstrate the µC/HTTP-server module capabilities. That code simply add two header fields to a response message for an HTML document.