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
()
| 2681 | // |
| 2682 | // However, whenever you can use the `ctx.Request().Body` instead. |
| 2683 | func (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. |
no test coverage detected