diff options
| author | Shulhan <ms@kilabit.info> | 2024-02-21 01:29:25 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2024-02-21 01:34:56 +0700 |
| commit | 9ca138628023b926ddf07cbd2e93562b8e782cf6 (patch) | |
| tree | b2c4524d4ed5ebd7098ad69c2917ee49159e2d93 /testdata/apiTargetRunHTTP_withTargetHeaders_test.txt | |
| parent | 99999635f67931e1a6deb608f13b2dc2ecd9df73 (diff) | |
| download | gorankusu-9ca138628023b926ddf07cbd2e93562b8e782cf6.tar.xz | |
all: add global HTTP headers for Target
The Headers field on Target define the global headers that will be send
along with all HTTPTarget or WebSocketTarget.
The same header can also be defined on HTTPTarget that override the
value of Target.
Diffstat (limited to 'testdata/apiTargetRunHTTP_withTargetHeaders_test.txt')
| -rw-r--r-- | testdata/apiTargetRunHTTP_withTargetHeaders_test.txt | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/testdata/apiTargetRunHTTP_withTargetHeaders_test.txt b/testdata/apiTargetRunHTTP_withTargetHeaders_test.txt new file mode 100644 index 0000000..83b8618 --- /dev/null +++ b/testdata/apiTargetRunHTTP_withTargetHeaders_test.txt @@ -0,0 +1,145 @@ +Test data for running HTTP target with global headers. + +>>> global:request_body +{ + "Target": { + "id": "example_http", + "headers": { + "Authorization": { + "kind": "string", + "value": "global-auth-value" + } + } + }, + "HTTPTarget": { + "id": "http_get", + "Method": 0, + "RequestType": 1, + "Path": "/example", + "Params": { + "Param1": { + "kind": "string", + "value": "value of param1" + } + } + } +} + +<<< global:RunResponse.DumpRequest +GET /example?Param1=value+of+param1 HTTP/1.1 +Host: 127.0.0.1:8217 +User-Agent: libhttp/0.53.0 +Authorization: global-auth-value +Accept-Encoding: gzip + + + +<<< global:RunResponse.DumpResponse +HTTP/1.1 200 OK +Content-Length: 275 +Content-Type: application/json + +{"data":{"Method":"GET","URL":"/example?Param1=value+of+param1","Headers":{"Accept-Encoding":["gzip"],"Authorization":["global-auth-value"],"User-Agent":["libhttp/0.53.0"]},"Form":{"Param1":["value of param1"]},"MultipartForm":null,"Body":""},"message":"/example","code":200} + +<<< global:RunResponse.ResponseBody +{ + "data": { + "Method": "GET", + "URL": "/example?Param1=value+of+param1", + "Headers": { + "Accept-Encoding": [ + "gzip" + ], + "Authorization": [ + "global-auth-value" + ], + "User-Agent": [ + "libhttp/0.53.0" + ] + }, + "Form": { + "Param1": [ + "value of param1" + ] + }, + "MultipartForm": null, + "Body": "" + }, + "message": "/example", + "code": 200 +} + +>>> override:request_body +{ + "Target": { + "id": "example_http", + "headers": { + "Authorization": { + "kind": "string", + "value": "global-auth-value" + } + } + }, + "HTTPTarget": { + "id": "http_get", + "Method": 0, + "RequestType": 1, + "Path": "/example", + "Headers": { + "Authorization": { + "kind": "string", + "value": "local-auth-value" + } + }, + "Params": { + "Param1": { + "kind": "string", + "value": "value of param1" + } + } + } +} + +<<< override:RunResponse.DumpRequest +GET /example?Param1=value+of+param1 HTTP/1.1 +Host: 127.0.0.1:8217 +User-Agent: libhttp/0.53.0 +Authorization: local-auth-value +Accept-Encoding: gzip + + + +<<< override:RunResponse.DumpResponse +HTTP/1.1 200 OK +Content-Length: 274 +Content-Type: application/json + +{"data":{"Method":"GET","URL":"/example?Param1=value+of+param1","Headers":{"Accept-Encoding":["gzip"],"Authorization":["local-auth-value"],"User-Agent":["libhttp/0.53.0"]},"Form":{"Param1":["value of param1"]},"MultipartForm":null,"Body":""},"message":"/example","code":200} + +<<< override:RunResponse.ResponseBody +{ + "data": { + "Method": "GET", + "URL": "/example?Param1=value+of+param1", + "Headers": { + "Accept-Encoding": [ + "gzip" + ], + "Authorization": [ + "local-auth-value" + ], + "User-Agent": [ + "libhttp/0.53.0" + ] + }, + "Form": { + "Param1": [ + "value of param1" + ] + }, + "MultipartForm": null, + "Body": "" + }, + "message": "/example", + "code": 200 +} |
