You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/content/guide/binding.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ type User struct {
27
27
}
28
28
```
29
29
30
-
Request data is binded to the struct in given order:
30
+
Request data is bound to the struct in given order:
31
31
32
32
1. Path parameters
33
33
2. Query parameters (only for GET/DELETE methods)
@@ -37,11 +37,11 @@ Notes:
37
37
38
38
* For `query`, `param`, `form`**only** fields **with** tags are bound.
39
39
* For `json` and `xml` can bind to *public* fields without tags but this is by their standard library implementation.
40
-
* Each step can overwrite binded fields from the previous step. This means if your json request has query param
40
+
* Each step can overwrite bound fields from the previous step. This means if your json request has query param
41
41
`&name=query` and body is `{"name": "body"}` then the result will be `User{Name: "body"}`.
42
-
* To avoid security flaws try to avoid passing binded structs directly to other methods if
42
+
* To avoid security flaws try to avoid passing bound structs directly to other methods if
43
43
these structs contain fields that should not be bindable. It is advisable to have separate struct for binding and map it
44
-
explicitly to your business struct. Consider what will happen if your binded struct has public
44
+
explicitly to your business struct. Consider what will happen if your bound struct has public
45
45
field `IsAdmin bool` and request body would contain `{IsAdmin: true, Name: "hacker"}`.
46
46
* When binding forms take note that Echo implementation uses standard library form parsing which parses form data
47
47
from BOTH URL and BODY if content type is not MIMEMultipartForm. See documentation for [non-MIMEMultipartForm](https://golang.org/pkg/net/http/#Request.ParseForm)
0 commit comments