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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user