ctx.Request equals to *http.Request.

Method Assertion

  1. func handler(ctx *clevergo.Context) error {
  2. // equals to ctx.IsMethod(http.MethodGet).
  3. if ctx.IsGet() {
  4. }
  5. // other shortcuts:
  6. //ctx.IsDelete()
  7. //ctx.IsPatch()
  8. //ctx.IsPost()
  9. //ctx.IsPut()
  10. //ctx.IsOptions()
  11. //ctx.IsAJAX()
  12. return nil
  13. }

Shortcuts

Method
Context.Cookie http.Request.Cookie
Context.Cookies http.Request.Cookies
Context.GetHeader http.Request.Header.Get
Context.FormValue http.Request.FormValue
Context.PostFormValue http.Request.PostFormValue
Context.QueryString http.Request.URL.RawQuery
Context.QueryParam http.Request.URL.Query().Get
Context.QueryParams http.Request.URL.Query()
Context.DefaultQuery QueryParam with default value