NaviServer Built-in Commands – 5.1.0
ns_parseheader - Parse HTTP header
This function parses a single HTTP header line into a predefined ns_set specified by set.
The headerline specifies a line containing HTTP header fields, where the field name is parsed into a key of the ns_set and the field value to the value of the entry.
The option -prefix can be used to specify a prefix for the key.
set reply [ns_set create -nocase reply] ns_parseheader $reply "Connection: Upgrade" # # Output the content of the ns_set in a human friendly way # ns_set format $reply ## output: reply: ## output: connection: Upgrade