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
Hey guys,
this might be more like a question than an issue, but is this behavior intended ?
I am getting the data from a multipart request in different ways using go1.9.2 and go1.10.
Getting the content with reg.FormValue("test")
go1.9.2:
http: no such file
Form Value: Hello go!
What did you see instead?
Getting the content with req.FormFile("test")
go1.10:
Form File: Hello go!
Form Value:
The text was updated successfully, but these errors were encountered:
Ogditsira
changed the title
mime/multipart: net/http Request.FormValue() / Request.FormFile behave differently between go1.9.2 and go1.10
mime/multipart: net/http Request.FormValue() / Request.FormFile() behave differently between go1.9.2 and go1.10
Feb 23, 2018
Hey guys,
this might be more like a question than an issue, but is this behavior intended ?
I am getting the data from a multipart request in different ways using go1.9.2 and go1.10.
Might have something to do with: https://golang.org/doc/go1.10#mime/multipart
What version of Go are you using (
go version
)?go1.9.2 linux/amd64
go1.10 linux/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64" GOBIN="" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/master/GoDev" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build036320343=/tmp/go-build -gno-record-gcc-switches" CXX="g++" CGO_ENABLED="1" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config"
What did you do?
Code:
Playground
Post:
POST HTTP/1.1
Host: localhost:4000
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
Cache-Control: no-cache
Postman-Token: de8ee739-757a-6107-bbe8-61134864d695
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="test"
Content-Type: text/plain
Hello go!
------WebKitFormBoundary7MA4YWxkTrZu0gW--
What did you expect to see?
Getting the content with
reg.FormValue("test")
go1.9.2:
http: no such file
Form Value: Hello go!
What did you see instead?
Getting the content with
req.FormFile("test")
go1.10:
Form File: Hello go!
Form Value:
The text was updated successfully, but these errors were encountered: