Header returns the header map that will be sent by
[ResponseWriter.WriteHeader]. The [Header] map also is the mechanism with which
[Handler] implementations can set HTTP trailers.
Changing the header map after a call to [ResponseWriter.WriteHeader] (or
[ResponseWriter.Write]) has no effect unless the HTTP status code was of the
1xx class or the modified headers are trailers.
There are two ways to set Trailers. The preferred way is to
predeclare in the headers which trailers you will later
send by setting the "Trailer" header to the names of the
trailer keys which will come later. In this case, those
keys of the Header map are treated as if they were
trailers. See the example. The second way, for trailer
keys not known to the [Handler] until after the first [ResponseWriter.Write],
is to prefix the [Header] map keys with the [TrailerPrefix]
constant value.
To suppress automatic response headers (such as "Date"), set
their value to nil.
Header returns the header map that will be sent by [ResponseWriter.WriteHeader]. The [Header] map also is the mechanism with which [Handler] implementations can set HTTP trailers.
Changing the header map after a call to [ResponseWriter.WriteHeader] (or [ResponseWriter.Write]) has no effect unless the HTTP status code was of the 1xx class or the modified headers are trailers.
There are two ways to set Trailers. The preferred way is to predeclare in the headers which trailers you will later send by setting the "Trailer" header to the names of the trailer keys which will come later. In this case, those keys of the Header map are treated as if they were trailers. See the example. The second way, for trailer keys not known to the [Handler] until after the first [ResponseWriter.Write], is to prefix the [Header] map keys with the [TrailerPrefix] constant value.
To suppress automatic response headers (such as "Date"), set their value to nil.