mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 02:31:04 +01:00
add godoc for #1533
Former-commit-id: face69d4018159e804c1461c8faf3e629a61b653
This commit is contained in:
parent
caa2545e3b
commit
350887d302
|
@ -667,9 +667,14 @@ type Context interface {
|
|||
// is false (as defaulted) in this case the caller should check the pointer to
|
||||
// see if something was actually binded.
|
||||
//
|
||||
// If a client sent an unknown field, this method will return an error,
|
||||
// in order to ignore that error use the `err != nil && !iris.IsErrPath(err)`.
|
||||
//
|
||||
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-form/main.go
|
||||
ReadForm(formObject interface{}) error
|
||||
// ReadQuery binds url query to "ptr". The struct field tag is "url".
|
||||
// If a client sent an unknown field, this method will return an error,
|
||||
// in order to ignore that error use the `err != nil && !iris.IsErrPath(err)`.
|
||||
//
|
||||
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-query/main.go
|
||||
ReadQuery(ptr interface{}) error
|
||||
|
@ -2923,6 +2928,9 @@ var ErrEmptyForm = errors.New("empty form")
|
|||
// is false (as defaulted) in this case the caller should check the pointer to
|
||||
// see if something was actually binded.
|
||||
//
|
||||
// If a client sent an unknown field, this method will return an error,
|
||||
// in order to ignore that error use the `err != nil && !iris.IsErrPath(err)`.
|
||||
//
|
||||
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-form/main.go
|
||||
func (ctx *context) ReadForm(formObject interface{}) error {
|
||||
values := ctx.FormValues()
|
||||
|
@ -2942,6 +2950,8 @@ func (ctx *context) ReadForm(formObject interface{}) error {
|
|||
}
|
||||
|
||||
// ReadQuery binds url query to "ptr". The struct field tag is "url".
|
||||
// If a client sent an unknown field, this method will return an error,
|
||||
// in order to ignore that error use the `err != nil && !iris.IsErrPath(err)`.
|
||||
//
|
||||
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-query/main.go
|
||||
func (ctx *context) ReadQuery(ptr interface{}) error {
|
||||
|
|
2
iris.go
2
iris.go
|
@ -579,7 +579,7 @@ var (
|
|||
// A shortcut for the `context#CookieEncoding`.
|
||||
CookieEncoding = context.CookieEncoding
|
||||
|
||||
// IsErrPath can be used at `context#ReadForm`.
|
||||
// IsErrPath can be used at `context#ReadForm` and `context#ReadQuery`.
|
||||
// It reports whether the incoming error is type of `formbinder.ErrPath`,
|
||||
// which can be ignored when server allows unknown post values to be sent by the client.
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue
Block a user