aboutsummaryrefslogtreecommitdiff
path: root/testdata/apiTargetRunHTTP_withTargetHeaders_test.txt
blob: 8d822f7585724add158a6a2aeca07e5cdc9892f5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
## SPDX-FileCopyrightText: 2024 M. Shulhan <ms@kilabit.info>
## SPDX-License-Identifier: GPL-3.0-or-later

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": "GET",
    "RequestType": "query",
    "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.60.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.60.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.60.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": "GET",
    "RequestType": "query",
    "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.60.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.60.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.60.0"
      ]
    },
    "Form": {
      "Param1": [
        "value of param1"
      ]
    },
    "MultipartForm": null,
    "Body": ""
  },
  "message": "/example",
  "code": 200
}