mirror of
https://github.com/gin-gonic/gin.git
synced 2026-01-10 08:27:00 +08:00
add GetHeader() to easily get header in Request
This commit is contained in:
parent
e2212d40c6
commit
701245fcd3
@ -390,6 +390,12 @@ func (c *Context) Header(key, value string) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetHeader is a shortcut for c.Request.Header.Get(key)
|
||||||
|
// It get the header in th request.
|
||||||
|
func (c *Context) GetHeader(key string) {
|
||||||
|
return c.Request.Header.Get(key)
|
||||||
|
}
|
||||||
|
|
||||||
func (c *Context) SetCookie(
|
func (c *Context) SetCookie(
|
||||||
name string,
|
name string,
|
||||||
value string,
|
value string,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user