func (v *verifier) ModifyRequest(req *http.Request) error {
	m := req.Method
	if v.method != "" && v.method != m {
		err := fmt.Errorf("request(%v) method verification error: got %v, want %v", req.URL,
			v.method, m)
		v.err.Add(err)
	}
	return nil
}
ModifyRequest verifies that the request's method matches the given method
in all modified requests. An error will be added to the contained *MultiError
if a method is unmatched.
package method
import (
	"encoding/json"
	"fmt"
	"net/http"
	"github.com/google/martian/v3"
	"github.com/google/martian/v3/parse"
	"github.com/google/martian/v3/verify"
)
type verifier struct {
	method string
	err    *martian.MultiError
}
type verifierJSON struct {
	Method string               `json:"method"`
	Scope  []parse.ModifierType `json:"scope"`
}
func init() {
	parse.Register("method.Verifier", verifierFromJSON)
}
func NewVerifier(method string) (verify.RequestVerifier, error) {
	if method == "" {
		return nil, fmt.Errorf("%s is not a valid HTTP method", method)
	}
	return &verifier{
		method: method,
		err:    martian.NewMultiError(),
	}, nil
}