Help us shape the future of Go! Take the 2026 Go Developer Survey

methods

package
v0.28.11 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Overview

Package methods implements a custom predicate to match routes based on the http method in request

It supports multiple http methods, with case-insensitive input

Examples:

// matches GET request
example1: Methods("GET") -> "http://example.org";

// matches GET or POST request
example1: Methods("GET", "post") -> "http://example.org";

Index

Constants

View Source
const MethodQuery = "QUERY"

MethodQuery represents the HTTP QUERY method defined in RFC 10008. net/http does not yet export MethodQuery.

Name is the predicate name Deprecated, use predicates.MethodsName instead

Variables

View Source
var ErrInvalidArgumentType = errors.New("only string values are allowed")
View Source
var ErrInvalidArgumentsCount = errors.New("at least one method should be specified")

Functions

func New

func New() routing.PredicateSpec

New creates a new Methods predicate specification

Types

This section is empty.

Jump to

Keyboard shortcuts

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