form
form copied to clipboard
:steam_locomotive: Decodes url.Values into Go value(s) and Encodes Go value(s) into url.Values. Dual Array and Full map support.
So How can I parse formdata to map[string]any directly like laravel?
### Package version eg. v9, v10: v4 ### Issue, Question or Enhancement: I want these two requests work at the same time: ``` curl host/api?queryTime=timestamp curl host/api?querytime=timestamp ``` In other...
It seems that `map` types are not supported. E.g. `map[interface{}]interface{}` or `map[string]string`. Is this the expected behaviour? [Play](https://play.golang.org/p/L9ZkYk-i3-D) ``` package main import ( "fmt" "github.com/go-playground/form" "net/url" "reflect" ) func main()...
### Package version eg. v9, v10: ### Issue, Question or Enhancement: can you tell me, how can i use this for multipart files?? ### Code sample, to showcase or reproduce:...
``` type Request struct { TestInt *int `form:"test_int"` TestString *string `form:"test_string"` } ``` When providing empty value for "test_string" parameter(r.Form["test_string"]=""), Request.TestString will be not nil and set with the zero...
```go fv, _ := form.NewEncoder().Encode(map[string]string{"a": "b"}) fmt.Printf(`the str="%s"`+"\n", fv.Encode()) ``` ``` the str="%5Ba%5D=b" ``` i will httpPost(xxx, encodeIt(x))
Example: ```go type Form struct { Field []string `form:"field"` } form := Form{ Field: []string{"value1", "value2"} } // vals is contains 'field': "value3", "value4" _ := Decoder.Decode(&form, vals) // form.Field...
While for most apps loose decoding is acceptable (and may be even preferable for speed), some require strict checking of form params (for ex. OAuth2 spec require this), and some...
If same field exists both in parent and embedded struct and url.Values has value only for parent then decoder incorrect set embedded field to same value. ```go type Embed struct...
Not crazy about the name, but essentially an option like gorilla/schema's IgnoreUnknownKeys option. Useful for really strict validation of incoming query params.