parse

package
v0.5.11 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UnsupportedMediaType = ErrorCode(1)
	MalformedInput       = ErrorCode(2)
)

Variables

This section is empty.

Functions

func Payload

func Payload(r *http.Request, value interface{}) error

Payload parses a request body, depending on the type set in Content-Type found in the headers. If no Content-Type is set in the headers, Payload will try to parse content from sent Form values.

Types

type Error

type Error struct {
	Message string
	Code    ErrorCode
}

func (Error) Error

func (e Error) Error() string

func (Error) String

func (e Error) String() string

type ErrorCode

type ErrorCode int

Jump to

Keyboard shortcuts

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