forms

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package forms assists working with web forms and Request.Form

Index

Constants

View Source
const DefaultFormMaxMemory = 1 << 20 // 1MiB

DefaultFormMaxMemory indicates the memory limit when parsing a form used when ParseForm is called without a positive number.

Variables

This section is empty.

Functions

func ParseForm

func ParseForm(req *http.Request, maxMemory int64) (err error)

ParseForm is similar to the standard request.ParseForm() but it handles urlencoded, multipart and JSON. For nested JSON objects ParseForm uses dots to join keys.

func ReadAll

func ReadAll(body io.Reader, maxBytes int64) ([]byte, error)

ReadAll read the whole body of a request but fails if it exceeds the given limit. If no limit is provided, DefaultFormMaxMemory will be used.

func UnmarshalFormJSON

func UnmarshalFormJSON(b []byte) (url.Values, error)

UnmarshalFormJSON attempts to convert a JSON document into a url.Values map.

Types

This section is empty.

Jump to

Keyboard shortcuts

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