fix: post form data

This commit is contained in:
debugtalk
2021-10-30 11:48:11 +08:00
parent a517203a19
commit 229a184ddb
6 changed files with 27 additions and 15 deletions

View File

@@ -49,7 +49,8 @@ var demoTestCase = &TestCase{
AssertEqual("body.json.foo2", 12.3, "check args foo2"),
Step("post form data").
POST("/post").
WithParams(map[string]interface{}{
WithHeaders(map[string]string{"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"}).
WithBody(map[string]interface{}{
"foo1": "$varFoo1", // reference former extracted variable
"foo2": "${max($a, $b)}", // 12.3; step level variables are independent, variable b is 3.45 here
}).