MCPcopy Create free account
hub / github.com/kataras/iris / GetBody

Method GetBody

context/context.go:2683–2690  ·  view source on GitHub ↗

GetBody reads and returns the request body. The default behavior for the http request reader is to consume the data readen but you can change that behavior by passing the `WithoutBodyConsumptionOnUnmarshal` Iris option or by calling the `RecordRequestBody` method. However, whenever you can use the

()

Source from the content-addressed store, hash-verified

2681//
2682// However, whenever you can use the `ctx.Request().Body` instead.
2683func (ctx *Context) GetBody() ([]byte, error) {
2684 body, release, err := GetBody(ctx.request, ctx.IsRecordingBody())
2685 if err != nil {
2686 return nil, err
2687 }
2688 release()
2689 return body, nil
2690}
2691
2692// Validator is the validator for request body on Context methods such as
2693// ReadJSON, ReadMsgPack, ReadXML, ReadYAML, ReadForm, ReadQuery, ReadBody and e.t.c.

Callers 10

UnmarshalBodyMethod · 0.95
ReadProtobufMethod · 0.95
ReadJSONProtobufMethod · 0.95
ReadMsgPackMethod · 0.95
ReadBodyMethod · 0.95
mainFunction · 0.80
logAllBodyFunction · 0.80
newAppFunction · 0.80
postTopicProduceHandlerFunction · 0.80
afterMethod · 0.80

Calls 2

IsRecordingBodyMethod · 0.95
GetBodyFunction · 0.85

Tested by

no test coverage detected