MCPcopy Index your code
hub / github.com/kataras/iris / Header

Method Header

context/context.go:1372–1378  ·  view source on GitHub ↗

+------------------------------------------------------------+ | 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)

Source from the content-addressed store, hash-verified

1370// Header adds a header to the response, if value is empty
1371// it removes the header by its name.
1372func (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
1380const contentTypeContextKey = "iris.content_type"
1381

Callers 15

SetLastModifiedMethod · 0.95
injectLiveReloadFunction · 0.45
BuildMethod · 0.45
TestNoCacheFunction · 0.45
TestStaticCacheFunction · 0.45
TestETagFunction · 0.45
browser.goFile · 0.45
TestCacheValidatorFunction · 0.45
NoCacheFunction · 0.45
ServeHTTPMethod · 0.45
ServeHTTPMethod · 0.45
ValidMethod · 0.45

Calls 2

DelMethod · 0.65
AddMethod · 0.45

Tested by 12

TestNoCacheFunction · 0.36
TestStaticCacheFunction · 0.36
TestETagFunction · 0.36
TestCacheValidatorFunction · 0.36
TestURLShortenerFunction · 0.36
TestVersionedControllerFunction · 0.36
TestRequestIDFunction · 0.36
TestMakeWrapperFuncFunction · 0.36
TestSetHostFunction · 0.36
sendJSONFunction · 0.36
TestNewGroupFunction · 0.36
TestDeprecatedFunction · 0.36