func MethodOverrideWithConfig(config MethodOverrideConfig) nio.MiddlewareFunc {
	if config.Skipper == nil {
		config.Skipper = DefaultMethodOverrideConfig.Skipper
	}
	if config.Getter == nil {
		config.Getter = DefaultMethodOverrideConfig.Getter
	}
	return func(next nio.HandlerFunc) nio.HandlerFunc {
		return func(c nio.Context) error {
			if config.Skipper(c) {
				return next(c)
			}
			req := c.Request()
			if req.Method == http.MethodPost {
				m := config.Getter(c)
				if m != "" {
					req.Method = m
				}
			}
			return next(c)
		}
	}
}
MethodOverrideWithConfig returns a MethodOverride middleware with config.
See: `MethodOverride()`.
package mw
import (
	"net/http"
	"github.com/go-nio/nio"
)
type (
	MethodOverrideConfig struct {
		Skipper nio.Skipper
		Getter MethodOverrideGetter
	}
	MethodOverrideGetter func(nio.Context) string
)
var (
	DefaultMethodOverrideConfig = MethodOverrideConfig{
		Skipper: nio.DefaultSkipper,
		Getter:  MethodFromHeader(nio.HeaderXHTTPMethodOverride),
	}
)
func MethodOverride() nio.MiddlewareFunc {
	return MethodOverrideWithConfig(DefaultMethodOverrideConfig)
}