aboutsummaryrefslogtreecommitdiff
path: root/testdata
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2024-02-05 03:21:53 +0700
committerShulhan <ms@kilabit.info>2024-02-05 03:23:00 +0700
commitf2cfe0de0eeec8bc7abf9d754b9e89681743ecff (patch)
tree802e8a32102a6786b4461e35b916d05b040558d0 /testdata
parentf02e4647bae78222196dc06406b5024c1b435bd7 (diff)
downloadgorankusu-f2cfe0de0eeec8bc7abf9d754b9e89681743ecff.tar.xz
all: implement form input file
The FormInput now can be set to FormInputKindFile that will rendered as "<input type='file' ...>" 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
Diffstat (limited to 'testdata')
-rw-r--r--testdata/target_http_run_formkindfile_test.txt49
1 files changed, 49 insertions, 0 deletions
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
+}