From c7c1558cc3036ff4db429fe2025c3690c307f95a Mon Sep 17 00:00:00 2001 From: duanhf2012 Date: Thu, 9 Apr 2020 10:54:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=A0=E9=99=A4=E8=8E=B7?= =?UTF-8?q?=E5=8F=96http=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sysservice/httpservice.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sysservice/httpservice.go b/sysservice/httpservice.go index 6c7c1bb..5a43629 100644 --- a/sysservice/httpservice.go +++ b/sysservice/httpservice.go @@ -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 }