Context.Error
,Context.NotFound
,Context.Redirect
,Context.ServeFile
,Context.ServeContent
return a nil error.Context.Error(msg string, code int)
was changed asContext.Error(code int, msg string)
.Context.Redirect(url string, code int)
was changed asContext.Redirect(code int, url string)
.
- Remove
Router.paramsPool
.
- Add
Skipper
. - Add
PathSkipper
. - Add
IRouter.Any
: registers a new request handler function that matches any HTTP methods. - Add
Context.SetHeader
: a shortcut ofhttp.ResponseWriter.Header().Set
.
- Add
Map
: an alias of map[string]interface{}. - Add
Decoder
,Router.Decoder
andContext.Decode
for decoding request's input. - Add
Context.Stringf
.
- Move contextPool out from router.
- Add middlewareStatePool.
- Add Context.DefaultQuery.
- Router.ServeFiles accepts route options.
- Add Context.ServeFile: a shortcut of http.ServeFile.
- Add Context.ServeContent: a shortcut of http.ServeContent.
- Add Context.BasicAuth: a shortcut of http.Request.BasicAuth.
- Add Context.SendFile: sends a file to browser.
- Add
Context.JSON
to send JSON response. - Add
Context.String
to send string response. - Add
Context.XML
to send XML response. Content.SetContentTypeJSON
andContent.SetContentTypeXML
appendcharset=utf-8
to content type header.- Add
Context.HTML
to send HTML response. - Add
Context.Cookie
andContext.Cookies
. - Add
Context.FormValue
. - Add
Context.PostFormValue
. - Add
Context.QueryString
. - Add
Context.QueryParams
andContext.QueryParam
. - Add
Context.JSONP
andContext.JSONPCallback
. - Add
Context.Render
to render a template. - Add
Context.RouteURL
to generate URL of the naming route. - Add
Context.Emit
andContext.Blob
. - Add
Context.HtmlBlob
. - Add
Context.XMLBlob
. - Add
Context.JSONBlob
. - Add
Context.JSONPBlob
andContext.JSONPCallbackBlob
. - Add
RecoveryLogger
.
- Fix
WrapHH
doesn't returns the error of final handle.
- Add
Context.GetHeader
, a shortcut of http.Request.Header.Get. - Add
WrapH
to wrap a HTTP handler as a middleware. - Add
WrapHH
to wrap func(http.Handler) http.Handler as a middleware.
- Add
Context.WriteHeader
, an alias of http.ResponseWriter.WriteHeader. - Add
Context.IsAJAX
to determine whether it is an AJAX request. - Write error to log.
- Bug #21 Fix the call sequence of middleware.