From f2cfe0de0eeec8bc7abf9d754b9e89681743ecff Mon Sep 17 00:00:00 2001 From: Shulhan Date: Mon, 5 Feb 2024 03:21:53 +0700 Subject: all: implement form input file The FormInput now can be set to FormInputKindFile that will rendered as "" on the web user interface. Once submitted, the file name, type, size, and lastModification will be stored under FormInput Filename, Filetype, Filesize, and Filemodms. Implements: https://todo.sr.ht/~shulhan/trunks/1 --- testdata/target_http_run_formkindfile_test.txt | 49 ++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 testdata/target_http_run_formkindfile_test.txt (limited to 'testdata') diff --git a/testdata/target_http_run_formkindfile_test.txt b/testdata/target_http_run_formkindfile_test.txt new file mode 100644 index 0000000..4f18347 --- /dev/null +++ b/testdata/target_http_run_formkindfile_test.txt @@ -0,0 +1,49 @@ +Test data for testing running HTTP with form kind is file (uploading file). + +>>> valid:http_request_body +{ + "Target": { + "id": "target_http" + }, + "HTTPTarget": { + "id": "upload", + "Method": 6, + "RequestType": 3, + "Path": "/upload", + "Params": { + "file": { + "kind": "file", + "value": "Q29udGVudCBvZiBmaWxlIHVwbG9hZA==", + "filename": "test.txt", + "filetype": "text/plain", + "filesize": 22 + } + } + } +} + +<<< valid:RunResponse.DumpResponse +HTTP/1.1 200 OK +Content-Length: 260 +Content-Type: application/json + +{ + "data": { + "filecontent": [ + "Q29udGVudCBvZiBmaWxlIHVwbG9hZA==" + ], + "filemodms": [ + "0" + ], + "filename": [ + "test.txt" + ], + "filesize": [ + "22" + ], + "filetype": [ + "text/plain" + ] + }, + "code": 200 +} -- cgit v1.3