chickadee » intarweb » update-header-contents!

replace-header-contents NAME CONTENTS HEADERSprocedure
replace-header-contents! NAME CONTENTS HEADERSprocedure
update-header-contents NAME CONTENTS HEADERSprocedure
update-header-contents! NAME CONTENTS HEADERSprocedure

The replace procedures replace any existing contents of the named header with new ones, the update procedures add these contents to the existing header. The procedures with a name ending in bang are linear update variants of the ones without the bang. The header contents have to be normalized to be a 2-element vector, with the first element being the actual value and the second element being an alist (possibly empty) of parameters/attributes for that value.

The update procedures append the value to the existing header if it is a multi-header, and act as a simple replace in the case of a single-header.

If you attempt to add a header that's not a proper 2-element vector, or if you try to combine raw and non-raw header values, this will raise an exception of type (exn http header-value).