Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 339 Bytes

using-handlers.md

File metadata and controls

21 lines (14 loc) · 339 Bytes

使用处理器 Using Handlers

type myHandlerGet struct {
}

func (m myHandlerGet) Serve(c *iris.Context) {
    c.Write("From %s", c.PathString())
}

// and so on

//等等...


iris.Handle("GET", "/get", myHandlerGet{})
iris.Handle("POST", "/post", post)
iris.Handle("PUT", "/put", put)
iris.Handle("DELETE", "/delete", del)