@@ -287,41 +287,38 @@ func (ctx *Context) Header() http.Header {
287287 return ctx .Resp .Header ()
288288}
289289
290- // FIXME: We should differ Query and Form, currently we just use form as query
291- // Currently to be compatible with macaron, we keep it.
292-
293- // Query returns request form as string with default
294- func (ctx * Context ) Query (key string , defaults ... string ) string {
290+ // Form returns request form as string with default
291+ func (ctx * Context ) Form (key string , defaults ... string ) string {
295292 return (* Forms )(ctx .Req ).MustString (key , defaults ... )
296293}
297294
298- // QueryTrim returns request form as string with default and trimmed spaces
299- func (ctx * Context ) QueryTrim (key string , defaults ... string ) string {
295+ // FormTrim returns request form as string with default and trimmed spaces
296+ func (ctx * Context ) FormTrim (key string , defaults ... string ) string {
300297 return (* Forms )(ctx .Req ).MustTrimmed (key , defaults ... )
301298}
302299
303- // QueryStrings returns request form as strings with default
304- func (ctx * Context ) QueryStrings (key string , defaults ... []string ) []string {
300+ // FormStrings returns request form as strings with default
301+ func (ctx * Context ) FormStrings (key string , defaults ... []string ) []string {
305302 return (* Forms )(ctx .Req ).MustStrings (key , defaults ... )
306303}
307304
308- // QueryInt returns request form as int with default
309- func (ctx * Context ) QueryInt (key string , defaults ... int ) int {
305+ // FormInt returns request form as int with default
306+ func (ctx * Context ) FormInt (key string , defaults ... int ) int {
310307 return (* Forms )(ctx .Req ).MustInt (key , defaults ... )
311308}
312309
313- // QueryInt64 returns request form as int64 with default
314- func (ctx * Context ) QueryInt64 (key string , defaults ... int64 ) int64 {
310+ // FormInt64 returns request form as int64 with default
311+ func (ctx * Context ) FormInt64 (key string , defaults ... int64 ) int64 {
315312 return (* Forms )(ctx .Req ).MustInt64 (key , defaults ... )
316313}
317314
318- // QueryBool returns request form as bool with default
319- func (ctx * Context ) QueryBool (key string , defaults ... bool ) bool {
315+ // FormBool returns request form as bool with default
316+ func (ctx * Context ) FormBool (key string , defaults ... bool ) bool {
320317 return (* Forms )(ctx .Req ).MustBool (key , defaults ... )
321318}
322319
323- // QueryOptionalBool returns request form as OptionalBool with default
324- func (ctx * Context ) QueryOptionalBool (key string , defaults ... util.OptionalBool ) util.OptionalBool {
320+ // FormOptionalBool returns request form as OptionalBool with default
321+ func (ctx * Context ) FormOptionalBool (key string , defaults ... util.OptionalBool ) util.OptionalBool {
325322 return (* Forms )(ctx .Req ).MustOptionalBool (key , defaults ... )
326323}
327324
0 commit comments