feat: support post json

This commit is contained in:
debugtalk
2021-09-23 21:53:30 +08:00
parent 2614d22003
commit c446f3bf81
2 changed files with 7 additions and 0 deletions

View File

@@ -32,6 +32,12 @@ func TestCaseHardcode(t *testing.T) {
WithParams(map[string]interface{}{"foo1": "bar1", "foo2": "bar2"}).
Validate().
AssertEqual("status_code", 200, "check status code"),
httpboomer.Step("post json data").
POST("/post").
WithHeaders(map[string]string{"User-Agent": "HttpBoomer"}).
WithJSON(map[string]interface{}{"foo1": "bar1", "foo2": "bar2"}).
Validate().
AssertEqual("status_code", 200, "check status code"),
httpboomer.Step("put request").
PUT("/put").
WithHeaders(map[string]string{"User-Agent": "HttpBoomer", "Content-Type": "text/plain"}).