rest

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: MIT Imports: 9 Imported by: 85

Documentation

Index

Constants

View Source
const DefaultMaxMemory = 32 << 20 // 32mb

DefaultMaxMemory defines the default max memory bytes that will be used when parsing a form request body.

Variables

This section is empty.

Functions

func BindBody

func BindBody(c echo.Context, i interface{}) error

BindBody binds request body content to i.

This is similar to `echo.BindBody()`, but for JSON requests uses custom json reader that **copies** the request body, allowing multiple reads.

func CopyJsonBody added in v0.8.0

func CopyJsonBody(r *http.Request, i interface{}) error

CopyJsonBody reads the request body into i by creating a copy of `r.Body` to allow multiple reads.

func FindUploadedFiles

func FindUploadedFiles(r *http.Request, key string) ([]*filesystem.File, error)

FindUploadedFiles extracts all form files of "key" from a http request and returns a slice with filesystem.File instances (if any).

func NormalizeUrl added in v0.5.0

func NormalizeUrl(originalUrl string) (string, error)

NormalizeUrl removes duplicated slashes from a url path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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