req

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBody

func GetBody(req *http.Request) ([]byte, error)

func GetFormData

func GetFormData(body []byte) (map[string]any, error)

func GetJsonData

func GetJsonData(body []byte) (map[string]any, error)

Types

type Body

type Body struct {
	Data  map[string]any
	Raw   []byte
	Empty bool
}

func CreateBody

func CreateBody(data map[string]any) (Body, error)

func GetReqBody

func GetReqBody(w http.ResponseWriter, req *http.Request) (Body, error)

func (Body) ToString

func (body Body) ToString() string

type BodyType

type BodyType string
const (
	Json    BodyType = "Json"
	Form    BodyType = "Form"
	Unknown BodyType = "Unknown"
)

func GetBodyType

func GetBodyType(req *http.Request) BodyType

Jump to

Keyboard shortcuts

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