mirror of
https://github.com/kataras/iris.git
synced 2025-03-12 01:34:14 +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
|
// is false (as defaulted) in this case the caller should check the pointer to
|
||||||
// see if something was actually binded.
|
// 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
|
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-form/main.go
|
||||||
ReadForm(formObject interface{}) error
|
ReadForm(formObject interface{}) error
|
||||||
// ReadQuery binds url query to "ptr". The struct field tag is "url".
|
// 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
|
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-query/main.go
|
||||||
ReadQuery(ptr interface{}) error
|
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
|
// is false (as defaulted) in this case the caller should check the pointer to
|
||||||
// see if something was actually binded.
|
// 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
|
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-form/main.go
|
||||||
func (ctx *context) ReadForm(formObject interface{}) error {
|
func (ctx *context) ReadForm(formObject interface{}) error {
|
||||||
values := ctx.FormValues()
|
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".
|
// 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
|
// Example: https://github.com/kataras/iris/blob/master/_examples/request-body/read-query/main.go
|
||||||
func (ctx *context) ReadQuery(ptr interface{}) error {
|
func (ctx *context) ReadQuery(ptr interface{}) error {
|
||||||
|
|
2
iris.go
2
iris.go
|
@ -579,7 +579,7 @@ var (
|
||||||
// A shortcut for the `context#CookieEncoding`.
|
// A shortcut for the `context#CookieEncoding`.
|
||||||
CookieEncoding = 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`,
|
// 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.
|
// which can be ignored when server allows unknown post values to be sent by the client.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue
Block a user