Header Operations
Working with the headers in a message involves knowing how to use the methods on the HeaderSet and on the individual Headers within the HeaderSet.
-
Adding new Headers
New headers can be added to the HeaderSet by using one of the provided add..Header() methods. -
Retrieving Headers
Headers are retrieved through the HeaderSet's get() and getAll() methods. -
Check if a Header Exists
You can check if a named header is present in a HeaderSet by calling its has() method. -
Removing Headers
Removing a Header from the HeaderSet is done by calling the HeaderSet's remove() or removeAll() methods. -
Modifying a Header's Content
To change a Header's content you should know what type of header it is and then call it's appropriate setter method. All headers also have a setFieldBodyModel() method that accepts a mixed parameter and delegates to the correct setter.
Parent topic: Message Headers
Previous topic: Header Types