Header is an intelligent shortcut for c.Writer.Header().Set(key, value). It writes a header in the response. If value == "", this method removes the header `c.Writer.Header().Del(key)`
(key, value string)
| 1078 | // It writes a header in the response. |
| 1079 | // If value == "", this method removes the header `c.Writer.Header().Del(key)` |
| 1080 | func (c *Context) Header(key, value string) { |
| 1081 | if value == "" { |
| 1082 | c.Writer.Header().Del(key) |
| 1083 | return |
| 1084 | } |
| 1085 | c.Writer.Header().Set(key, value) |
| 1086 | } |
| 1087 | |
| 1088 | // GetHeader returns value from request headers. |
| 1089 | func (c *Context) GetHeader(key string) string { |