Skip to content

Commit

Permalink
feat: add ctx.Body()
Browse files Browse the repository at this point in the history
  • Loading branch information
Duslia committed Jun 6, 2022
1 parent 753ef4f commit b881803
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/app/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -968,10 +968,16 @@ func (ctx *RequestContext) GetHeader(key string) []byte {
}

// GetRawData returns body data.
// Deprecated: use ctx.Body() instead.
func (ctx *RequestContext) GetRawData() []byte {
return ctx.Request.Body()
}

// Body returns body data
func (ctx *RequestContext) Body() ([]byte, error) {
return ctx.Request.BodyE()
}

type ClientIP func(ctx *RequestContext) string

var defaultClientIP = func(ctx *RequestContext) string {
Expand Down

0 comments on commit b881803

Please sign in to comment.