working commit
This commit is contained in:
@@ -24,6 +24,10 @@ func NewContext(writer http.ResponseWriter, request *http.Request) *Context {
|
||||
return rctx
|
||||
}
|
||||
|
||||
func (rctx *Context) SetHeader(key, value string) {
|
||||
rctx.Writer.Header().Set(key, value)
|
||||
}
|
||||
|
||||
func (rctx *Context) SetStatus(httpStatus int) {
|
||||
rctx.Writer.WriteHeader(httpStatus)
|
||||
}
|
||||
@@ -37,3 +41,7 @@ func (rctx *Context) SendText(payload string) {
|
||||
rctx.Writer.Header().Set("Content-Type", "text/plain")
|
||||
rctx.Writer.Write([]byte(payload))
|
||||
}
|
||||
|
||||
func (rctx *Context) GetHeader(key string) string {
|
||||
return rctx.Request.URL.Query().Get(key)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user