methods

package
v2.0.4 Latest Latest
Warning

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

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

Documentation

Overview

Package methods provides functionality for handling HTTP methods

Index

Constants

View Source
const (

	// MethodPurge is the PURGE HTTP Method
	MethodPurge = "PURGE"
)

Variables

This section is empty.

Functions

func AllHTTPMethods

func AllHTTPMethods() []string

AllHTTPMethods returns a list of all known HTTP methods

func AreEqual

func AreEqual(l1, l2 []string) bool

func CacheableHTTPMethods

func CacheableHTTPMethods() []string

CacheableHTTPMethods returns a list of HTTP methods that are generally considered cacheable

func GetAndPost

func GetAndPost() []string

GetAndPost returns a string slice containing "GET" and "POST"

func HasAll

func HasAll(methods1, methods2 []string) bool

HasAll returns true if methods2 contains all methods from methods1

func HasAny

func HasAny(methods1, methods2 []string) bool

HasAny returns true if methods2 contains any methods from methods1

func HasBody

func HasBody(method string) bool

HasBody returns true if the method is POST, PUT or PATCH

func IsCacheable

func IsCacheable(method string) bool

IsCacheable returns true if the method is HEAD or GET

func IsValidMethod

func IsValidMethod(method string) bool

IsValidMethod returns true if the provided method is recognized in methodsMap

func MethodMask

func MethodMask(methods ...string) uint16

MethodMask returns the integer representation of the collection of methods based on the iota bitmask defined above

func UncacheableHTTPMethods

func UncacheableHTTPMethods() []string

UncacheableHTTPMethods returns a list of HTTP methods that are generally considered uncacheable

Types

This section is empty.

Jump to

Keyboard shortcuts

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