Headers
A large amount of HTTP header fields exist with the HTTP v1.1 protocol and many more have been added and continue to be added as extension features. Those headers fields are included in HTTP requests and responses and they defined additional parameters for the HTTP transaction. They are used for authentication, cookies, accepted file types and the list go on. Some are specific to requests, others to responses and some are global to both. You can found the list of recognized header fields by the µC/HTTP products in the section HTTP Header Fields Recognized.Â
µC/HTTP-server
µC/HTTP-server supports the reception of headers in HTTP requests and the addition of headers in HTTP responses to send. Only headers recognized by the HTTP server stack can be accepted and added (See HTTP Header Fields Recognized).
See section Header Field Configuration to enable the Header Field feature.
See section HTTP Header Fields for more details on the configuration and usage of this feature.Â
µC/HTTP-client
µC/HTTP-client supports the addition of HTTP header field to requests and the parsing of header fields received in responses. For header fields in requests, two methods are offered to add them into a request. First, a table with all the header fields to include in the request can be passed to the µC/HTTP-client stack; second, a hook function can be set up. The hook function will be called by the µC/HTTP-client stack to add a header field at the moment where the request is constructed. The hook function will be called until it return a "I'm Done" value to indicate that all header fields have been passed. For the header fields in responses, a hook function can be set up to allow the application to recover the data in the received header fields.
See Section Header Field Configuration to enable the Header Field feature.Â
See Section Header fields for examples on how to add Header Fields to a HTTP request with the use of a table or a hook function.
See Section Response Header Hook for an example of a hook function to recover header fields received in an HTTP response.