1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-17 03:02:28 +08:00

fix: fix http post to support multipart/form-data header

This commit is contained in:
dudaodong
2022-04-14 11:39:21 +08:00
parent 1aefd6aa12
commit 39d373d37b
2 changed files with 25 additions and 1 deletions

View File

@@ -84,7 +84,7 @@ func setHeaderAndQueryAndBody(req *http.Request, reqUrl string, header, queryPar
}
if req.Header.Get("Content-Type") == "multipart/form-data" || req.Header.Get("Content-Type") == "application/x-www-form-urlencoded" {
formData := queryParam.(url.Values)
err = setBodyByte(req, formData.Encode())
err = setBodyByte(req, []byte(formData.Encode()))
} else {
err = setBodyByte(req, body)
}