|
5 | 5 | "encoding/xml" |
6 | 6 | "io" |
7 | 7 | "mime" |
| 8 | + "mime/multipart" |
8 | 9 | "net/http" |
9 | 10 | "os" |
10 | 11 | "path" |
@@ -51,11 +52,20 @@ type ( |
51 | 52 | // ParamNames returns path parameter names. |
52 | 53 | ParamNames() []string |
53 | 54 |
|
54 | | - // Query returns query parameter by name. |
55 | | - Query(string) string |
| 55 | + // QueryParam returns the query param for the provided name. It is an alias |
| 56 | + // for `engine.URL#QueryParam()`. |
| 57 | + QueryParam(string) string |
56 | 58 |
|
57 | | - // Form returns form parameter by name. |
58 | | - Form(string) string |
| 59 | + // FormValue returns the form field value for the provided name. It is an |
| 60 | + // alias for `engine.Request#FormValue()`. |
| 61 | + FormValue(string) string |
| 62 | + |
| 63 | + // FormFile returns the multipart form file for the provided name. It is an |
| 64 | + // alias for `engine.Request#FormFile()`. |
| 65 | + FormFile(string) (*multipart.FileHeader, error) |
| 66 | + |
| 67 | + // MultipartForm returns the multipart form. It is an alias for `engine.Request#MultipartForm()`. |
| 68 | + MultipartForm() (*multipart.Form, error) |
59 | 69 |
|
60 | 70 | // Get retrieves data from the context. |
61 | 71 | Get(string) interface{} |
@@ -221,14 +231,22 @@ func (c *context) ParamNames() []string { |
221 | 231 | return c.pnames |
222 | 232 | } |
223 | 233 |
|
224 | | -func (c *context) Query(name string) string { |
225 | | - return c.request.URL().QueryValue(name) |
| 234 | +func (c *context) QueryParam(name string) string { |
| 235 | + return c.request.URL().QueryParam(name) |
226 | 236 | } |
227 | 237 |
|
228 | | -func (c *context) Form(name string) string { |
| 238 | +func (c *context) FormValue(name string) string { |
229 | 239 | return c.request.FormValue(name) |
230 | 240 | } |
231 | 241 |
|
| 242 | +func (c *context) FormFile(name string) (*multipart.FileHeader, error) { |
| 243 | + return c.request.FormFile(name) |
| 244 | +} |
| 245 | + |
| 246 | +func (c *context) MultipartForm() (*multipart.Form, error) { |
| 247 | + return c.request.MultipartForm() |
| 248 | +} |
| 249 | + |
232 | 250 | func (c *context) Set(key string, val interface{}) { |
233 | 251 | if c.store == nil { |
234 | 252 | c.store = make(store) |
|
0 commit comments