request

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HeaderAccept      = "Accept"
	HeaderContentType = "Content-Type"

	ContentTypeHtml   = "text/html"
	ContentTypeJson   = "application/json"
	ContentTypeBinary = "application/octet-stream"
)

Variables

This section is empty.

Functions

func CSRFMiddleware

func CSRFMiddleware() gin.HandlerFunc

CSRFMiddleware implements CSRF protection middleware

func GenerateCSRFToken

func GenerateCSRFToken(c *gin.Context) string

GenerateCSRFToken generates a CSRF token for the current session

func IsJSONRequest

func IsJSONRequest(ctx *gin.Context) bool

IsJSONRequest returns true if request is a JSON request

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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