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

fix: fix body param bug when send post request

This commit is contained in:
dudaodong
2023-05-30 10:51:33 +08:00
parent f38f69ce17
commit 64982f0c89
4 changed files with 106 additions and 102 deletions

View File

@@ -49,8 +49,8 @@ func TestHttpPost(t *testing.T) {
func TestHttpPostFormData(t *testing.T) {
apiUrl := "https://jsonplaceholder.typicode.com/todos"
header := map[string]string{
// "Content-Type": "application/x-www-form-urlencoded",
"Content-Type": "multipart/form-data",
"Content-Type": "application/x-www-form-urlencoded",
// "Content-Type": "multipart/form-data",
}
postData := url.Values{}
@@ -61,7 +61,7 @@ func TestHttpPostFormData(t *testing.T) {
// postData["userId"] = "1"
// postData["title"] = "title"
resp, err := HttpPost(apiUrl, header, postData, nil)
resp, err := HttpPost(apiUrl, header, nil, postData)
if err != nil {
log.Fatal(err)
}