MCPcopy
hub / github.com/gin-gonic/gin / AbortWithStatusPureJSON

Method AbortWithStatusPureJSON

context.go:222–225  ·  view source on GitHub ↗

AbortWithStatusPureJSON calls `Abort()` and then `PureJSON` internally. This method stops the chain, writes the status code and return a JSON body without escaping. It also sets the Content-Type as "application/json".

(code int, jsonObj any)

Source from the content-addressed store, hash-verified

220// This method stops the chain, writes the status code and return a JSON body without escaping.
221// It also sets the Content-Type as "application/json".
222func (c *Context) AbortWithStatusPureJSON(code int, jsonObj any) {
223 c.Abort()
224 c.PureJSON(code, jsonObj)
225}
226
227// AbortWithStatusJSON calls `Abort()` and then `JSON` internally.
228// This method stops the chain, writes the status code and return a JSON body.

Callers 1

Calls 2

AbortMethod · 0.95
PureJSONMethod · 0.95

Tested by 1