We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如果File不为空,且FormFile包裹的是一个正确的文件名,File的名字就是multipart/form-data filename里面的名字。 代码举例
package main import ( "fmt" "github.com/guonaihong/gout" ) func main() { err := gout.POST(":1234").Debug(true).SetForm(gout.H{"voice": gout.FormType{FileName: "new-file-name", File: gout.FormFile("./voice.pcm")}}).Do() fmt.Printf("err:%s\n", err) }
> POST / HTTP/1.1 > Content-Type: multipart/form-data; boundary=c13f1e919fc51a4110b8d387faccb9da8828ed72dcd6f939ed9893b1cf44 > --c13f1e919fc51a4110b8d387faccb9da8828ed72dcd6f939ed9893b1cf44 Content-Disposition: form-data; name="voice"; filename="./voice.pcm" Content-Type: application/octet-stream wowowowow wowowowow wowowowow --c13f1e919fc51a4110b8d387faccb9da8828ed72dcd6f939ed9893b1cf44-- < HTTP/1.1 200 OK < Server: gurl-server < Date: Wed, 22 Jul 2020 10:46:42 GMT < Content-Length: 0
> POST / HTTP/1.1 > Content-Type: multipart/form-data; boundary=c13f1e919fc51a4110b8d387faccb9da8828ed72dcd6f939ed9893b1cf44 > --c13f1e919fc51a4110b8d387faccb9da8828ed72dcd6f939ed9893b1cf44 Content-Disposition: form-data; name="voice"; filename="new-file-name" Content-Type: application/octet-stream wowowowow wowowowow wowowowow wowowowow wowowowow wowowowow --c13f1e919fc51a4110b8d387faccb9da8828ed72dcd6f939ed9893b1cf44-- < HTTP/1.1 200 OK < Server: gurl-server < Date: Wed, 22 Jul 2020 10:46:42 GMT < Content-Length: 0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
如果File不为空,且FormFile包裹的是一个正确的文件名,File的名字就是multipart/form-data filename里面的名字。
代码举例
The text was updated successfully, but these errors were encountered: