formparse

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

README

caddy-form-parse

Caddy v2 module for parsing form data in request body, forked from caddy-json-parse

Installation

xcaddy build v2.0.0 \
    --with github.com/lemniskett/caddy-form-parse

Usage

form_parse parses the request body as form data for reference as placeholders.

Caddyfile

Simply use the directive anywhere in a route. You can define formvalue multiple times to parse multiple keys.

form_parse <formvalue...>

And reference variables via {form.*} placeholders.

License

Apache 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FormParse

type FormParse struct {
	FormKeys []string
	// contains filtered or unexported fields
}

FormParse implements an HTTP handler that parses form body as placeholders.

func (FormParse) CaddyModule

func (FormParse) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*FormParse) Provision

func (f *FormParse) Provision(ctx caddy.Context) error

Provision implements caddy.Provisioner.

func (FormParse) ServeHTTP

func (f FormParse) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

ServeHTTP implements caddyhttp.MiddlewareHandler.

func (*FormParse) UnmarshalCaddyfile

func (f *FormParse) UnmarshalCaddyfile(d *caddyfile.Dispenser) error

UnmarshalCaddyfile implements caddyfile.Unmarshaler.

Jump to

Keyboard shortcuts

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