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

Method Status

context/problem.go:151–165  ·  view source on GitHub ↗

Status sets HTTP error code for problem's status field. Example: 404 It is required.

(statusCode int)

Source from the content-addressed store, hash-verified

149//
150// It is required.
151func (p Problem) Status(statusCode int) Problem {
152 shouldOverrideTitle := !p.keyExists("title")
153
154 // if !shouldOverrideTitle {
155 // typ, found := p["type"]
156 // shouldOverrideTitle = !found || isEmptyTypeURI(typ.(string))
157 // }
158
159 if shouldOverrideTitle {
160 // Set title by code.
161 p.Title(http.StatusText(statusCode))
162 }
163
164 return p.Key("status", statusCode)
165}
166
167// Detail sets the problem's detail field.
168// Example: "Optional details about the error...".

Callers 15

TestNoCacheFunction · 0.80
TestStaticCacheFunction · 0.80
TestCache304Function · 0.80
TestETagFunction · 0.80
runTestFunction · 0.80
TestCacheValidatorFunction · 0.80
testSessionsFunction · 0.80
TestFlashMessagesFunction · 0.80
TestSessionsEncodeDecodeFunction · 0.80
TestURLShortenerFunction · 0.80

Calls 3

keyExistsMethod · 0.95
TitleMethod · 0.95
KeyMethod · 0.95

Tested by 15

TestNoCacheFunction · 0.64
TestStaticCacheFunction · 0.64
TestCache304Function · 0.64
TestETagFunction · 0.64
runTestFunction · 0.64
TestCacheValidatorFunction · 0.64
testSessionsFunction · 0.64
TestFlashMessagesFunction · 0.64
TestSessionsEncodeDecodeFunction · 0.64
TestURLShortenerFunction · 0.64