Add Response Header Field
Figure 4This hook function is called by μC/HTTPs before starting to transmit the response message as shown on Figure 4-1. 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).
...
otherwise.
Required Configuration
See section 4-4-6 “Instance Header Field Configuration” on page 29.
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
Listing 4-18 is shown to demonstrate the µC/HTTPs module capabilities. That code simply add two header fields to a response message for an HTML document.
Listing 4-21 Add Header field hook function example code
L4-21(1) Ensure that we don’t add header field to a response with an error
...