ginutils

package
v0.0.0-...-67f9e3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseBody

func ParseBody[B any](ctx context.Context, c *gin.Context) (body B, err error)

func ParseBodyWith

func ParseBodyWith[B any](ctx context.Context, c *gin.Context, parse func(io.Reader) (B, error)) (body B, err error)

func ParseOptionalBody

func ParseOptionalBody[B any](ctx context.Context, c *gin.Context) (body B, err error)

ParseOptionalBody parses an optional JSON request body. Unlike ParseBody it tolerates an absent or empty body, returning the zero value and no error — and it does so without consulting Content-Length, which is -1 under chunked transfer encoding even when a body is present. A present-but-malformed body still returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL