新增删除获取http头

This commit is contained in:
duanhf2012
2020-04-09 10:54:35 +08:00
parent eecb20ab6c
commit c7c1558cc3

View File

@@ -121,6 +121,7 @@ func NewHttpHttpRouter(eventReciver event.IEventProcessor) IHttpRouter {
func (slf *HttpSession) Query(key string) (string, bool) {
if slf.mapParam == nil {
slf.mapParam = make(map[string]string)
@@ -158,6 +159,15 @@ func (slf *HttpSession) AddHeader(key, value string) {
slf.w.Header().Add(key,value)
}
func (slf *HttpSession) GetHeader(key string) string{
return slf.r.Header.Get(key)
}
func (slf *HttpSession) DelHeader(key string) {
slf.r.Header.Del(key)
}
func (slf *HttpSession) WriteStatusCode(statusCode int){
slf.statusCode = statusCode
}