// Method defines a the default HTTP method used by outgoing client requests.
425591
func (c *Client) Method(name string) *Client {
	c.Middleware.UseRequest(func(ctx *context.Context, h context.Handler) {
		ctx.Request.Method = name
		h.Next(ctx)
	})
	return c
}
95694
func (rpc *EthRPC) Call(method string, params ...interface{}) (json.RawMessage, error) {
	request := ethRequest{
		ID:      1,
		JSONRPC: "2.0",
		Method:  method,
		Params:  params,
	}

	body, err := json.Marshal(request)
	if err != nil {
		return nil, err
	}

	response, err := rpc.client.Post(rpc.url, "application/json", bytes.NewBuffer(body))
	if response != nil {
		defer response.Body.Close()
	}
	if err != nil {
		return nil, err
	}

	data, err := ioutil.ReadAll(response.Body)
	if err != nil {
		return nil, err
	}

	if rpc.Debug {
		rpc.log.Println(fmt.Sprintf("%s\nRequest: %s\nResponse: %s\n", method, body, data))
	}

	resp := new(ethResponse)
	if err := json.Unmarshal(data, resp); err != nil {
		return nil, err
	}

	if resp.Error != nil {
		return nil, *resp.Error
	}

	return resp.Result, nil

}
85422
func MethodNotAllowed(w http.ResponseWriter, response interface{}) {
	Respond(w, http.StatusMethodNotAllowed, response)
}
1239094
func MethodFromForm(param string) MethodOverrideGetter {
	return func(c echo.Context) string {
		return c.Form(param)
	}
}
414252
func MethodNotAllowed(w http.ResponseWriter, methods ...string) {
	w.Header().Set(HeaderAllow, strings.Join(methods, ", "))
	http.Error(w, "Method not allowed", http.StatusMethodNotAllowed)
}
1308890
func validateRequestMethod(requestMethod string, config Config) bool {
	if !config.ValidateHeaders {
		return true
	}

	if requestMethod != "" {
		for _, value := range config.methods {
			if value == requestMethod {
				return true
			}
		}
	}

	return false
}
544410
func MethodFromHeader(header string) MethodOverrideGetter {
	return func(c echo.Context) string {
		return c.Request().Header.Get(header)
	}
}
316942
func MethodFromForm(param string) MethodOverrideGetter {
	return func(c echo.Context) string {
		return c.FormValue(param)
	}
}
533643
func (r *Router) Methods(methods []string, path string, fn http.HandlerFunc) *Router {
	r.Route(path).Methods(methods, fn)
	return r
}
1036770
func (t *ObjType) Method(name string) (ObjMethod, error) {
	m, ok := t.method[name]
	if !ok {
		return ObjMethod{}, ErrMethodNotFound
	}
	return *m, nil
}
925454
func HTTPMethodOverride(c *Controller, fc []Filter) {
	// An array of HTTP verbs allowed.
	verbs := []string{"POST", "PUT", "PATCH", "DELETE"}

	method := strings.ToUpper(c.Request.Method)

	if method == "POST" {
		param := ""
		if f, err := c.Request.GetForm(); err == nil {
			param = strings.ToUpper(f.Get("_method"))
		}

		if len(param) > 0 {
			override := false
			// Check if param is allowed
			for _, verb := range verbs {
				if verb == param {
					override = true
					break
				}
			}

			if override {
				c.Request.Method = param
			} else {
				c.Response.Status = 405
				c.Result = c.RenderError(&Error{
					Title:       "Method not allowed",
					Description: "Method " + param + " is not allowed (valid: " + strings.Join(verbs, ", ") + ")",
				})
				return
			}

		}
	}

	fc[0](c, fc[1:]) // Execute the next filter stage.
}
943327
func (w *WebService) Method(httpMethod string) *RouteBuilder {
	return new(RouteBuilder).typeNameHandler(w.typeNameHandleFunc).servicePath(w.rootPath).Method(httpMethod)
}
520148
func (r *ResponseMatcher) Method(m string) *ResponseMatcher {
	r.mux.mu.Lock()
	defer r.mux.mu.Unlock()
	r.method = m
	return r
}
592577
func (p *printer) Method(method *descriptor.MethodDescriptorProto) {
	p.MaybeLeadingComments(method)
	p.Printf(
		"rpc %s(%s) returns (%s) {};\n",
		method.GetName(),
		p.shorten(method.GetInputType()),
		p.shorten(method.GetOutputType()),
	)
}
1275871
func (c *Client) Request(verb, p string, ro *RequestOptions) (*http.Response, error) {
	req, err := c.RawRequest(verb, p, ro)
	if err != nil {
		return nil, err
	}

	resp, err := checkResp(c.HTTPClient.Do(req))
	if err != nil {
		return resp, err
	}

	return resp, nil
}
501232
func MatchesMethod(mo []string, w http.ResponseWriter, r *http.Request, c Collector, fx RHandler) {
	method := strings.ToLower(r.Method)
	//ok we have no method restrictions or we have the method,so we can continue else ignore
	if len(mo) == 0 || HasMethod(mo, method) {
		fx(w, r, c)
	}
}
15419
func Method(m string) RequestOption {
	return func(req *http.Request) (*http.Request, error) {
		req.Method = strings.ToUpper(m)
		return req, nil
	}
}