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 /testdata | |
| 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 'testdata')
| -rw-r--r-- | testdata/target_http_run_withrawbody_json_test.txt | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/testdata/target_http_run_withrawbody_json_test.txt b/testdata/target_http_run_withrawbody_json_test.txt new file mode 100644 index 0000000..c332987 --- /dev/null +++ b/testdata/target_http_run_withrawbody_json_test.txt @@ -0,0 +1,33 @@ +Test data for testing [HTTPTarget.WithRawBody]. + +>>> valid:http_request_body +{ + "Target": { + "id": "target_http" + }, + "HTTPTarget": { + "id": "rawbody_json", + "Method": 6, + "RequestType": 4, + "Path": "/rawbody/json", + "RawBody": "eyJpZCI6MSwibmFtZSI6ImdvcmFua3VzdSJ9", + "WithRawBody": true + } +} + +<<< valid:RunResponse.DumpRequest +POST /rawbody/json HTTP/1.1 +Host: 127.0.0.1:22796 +User-Agent: libhttp/0.53.0 +Content-Length: 27 +Content-Type: application/json +Accept-Encoding: gzip + +{"id":1,"name":"gorankusu"} + +<<< valid:RunResponse.DumpResponse +HTTP/1.1 200 OK +Content-Length: 47 +Content-Type: application/json + +{"data":{"id":1,"name":"gorankusu"},"code":200} |
