diff options
| author | Shulhan <ms@kilabit.info> | 2024-02-08 16:29:46 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-02-08 16:30:00 +0700 |
| commit | 4641925909819c6a93fb774cf1ca77805b74210d (patch) | |
| tree | 68b17a4ba2db95245d0aff6de93ae36da12302bd /gorankusu_test.go | |
| parent | a390baed9f16c61c9c431691be7bb10151fcde10 (diff) | |
| download | gorankusu-4641925909819c6a93fb774cf1ca77805b74210d.tar.xz | |
all: allow submit free form request body in HTTPTarget
In HTTPTarget the field RawBody can be filled by anything by user.
Those field can be activated by setting WithRawBody.
Implements: https://todo.sr.ht/~shulhan/gorankusu/3
Diffstat (limited to 'gorankusu_test.go')
| -rw-r--r-- | gorankusu_test.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gorankusu_test.go b/gorankusu_test.go index 14d0643..99ed214 100644 --- a/gorankusu_test.go +++ b/gorankusu_test.go @@ -70,6 +70,23 @@ func registerTargetHTTP() { } target.HTTPTargets = append(target.HTTPTargets, targetHTTPUpload) + var targetHTTPRawbodyJSON = &HTTPTarget{ + ID: `rawbody_json`, + Name: `Raw body in JSON`, + Method: dummyEndpointRawbodyJSON.Method, + Path: dummyEndpointRawbodyJSON.Path, + RequestType: dummyEndpointRawbodyJSON.RequestType, + Params: KeyFormInput{ + `ignored`: FormInput{ + Label: `Ignored parameter`, + }, + }, + RequestDumper: requestDumperWithoutDate, + ResponseDumper: responseDumperWithoutDate, + WithRawBody: true, + } + target.HTTPTargets = append(target.HTTPTargets, targetHTTPRawbodyJSON) + var err = dummyGorankusu.RegisterTarget(target) if err != nil { log.Fatalf(`%s: %s`, logp, err) |
