MergeHeader
合并HTTP响应头
Example
package main
import (
"github.com/vicanso/elton"
"github.com/vicanso/elton/middleware"
)
func main() {
e := elton.New()
e.Use(middleware.NewDefaultResponder())
e.GET("/", func(c *elton.Context) (err error) {
h := make(http.Header)
h.Add("X-Response-Id", "1")
h.Add("X-Response-Id", "2")
c.MergeHeader(h)
c.Body = c.Header()
return
})
err := e.ListenAndServe(":3000")
if err != nil {
panic(err)
}
}