+------------------------------------------------------------+ | Response Headers helpers | +------------------------------------------------------------+ Header adds a header to the response, if value is empty it removes the header by its name.
(name string, value string)
| 1370 | // Header adds a header to the response, if value is empty |
| 1371 | // it removes the header by its name. |
| 1372 | func (ctx *Context) Header(name string, value string) { |
| 1373 | if value == "" { |
| 1374 | ctx.writer.Header().Del(name) |
| 1375 | return |
| 1376 | } |
| 1377 | ctx.writer.Header().Add(name, value) |
| 1378 | } |
| 1379 | |
| 1380 | const contentTypeContextKey = "iris.content_type" |
| 1381 |