set

abstract operator fun set(headerName: String, headerValue: String?)

Sets the header named headerName to the given headerValue.

Standard headers should be set using type-safe accessors, so this untyped approach should be exclusively used for custom headers.

The specification is rather imprecise as to which frames may or may not contain custom headers. The following sentence opens the door for custom headers in all frames:

Finally, STOMP servers MAY use additional headers to give access to features like persistence or expiration. Consult your server's documentation for details.

For this reason, custom headers are allowed in every frame here. Please use this method carefully.