request

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReqHeaders

func GetReqHeaders(req *http.Request) map[string][]string

Get headers from request

func ParseHeaders

func ParseHeaders(headers map[string][]string) map[string]any

Parse headers into `map[string]any`

func ReadBody

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

Read body from request

Types

type Body

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

func CreateBody

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

Create new body with data

func GetReqBody

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

Get body from request

func (Body) ToString

func (body Body) ToString() string

Body to string

func (*Body) Write

func (body *Body) Write(req *http.Request) error

Write body into request

type BodyType

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

Jump to

Keyboard shortcuts

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