forked from TykTechnologies/tyk-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
httpbin_transform.yaml
76 lines (75 loc) · 2.1 KB
/
httpbin_transform.yaml
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
apiVersion: tyk.tyk.io/v1alpha1
kind: ApiDefinition
metadata:
name: httpbin-transform
spec:
name: httpbin-transform
use_keyless: true
protocol: http
active: true
proxy:
target_url: http://httpbin.org
listen_path: /httpbin-transform
strip_listen_path: true
response_processors:
- name: response_body_transform
- name: header_injector
version_data:
default_version: Default
not_versioned: true
versions:
Default:
name: Default
use_extended_paths: true
paths:
black_list: [ ]
ignored: [ ]
white_list: [ ]
extended_paths:
transform:
- method: POST
path: /anything
template_data:
enable_session: false
input_type: json
template_mode: blob
# base64 encoded template
template_source: eyJiYXIiOiAie3suZm9vfX0ifQ==
transform_response:
- method: GET
path: /xml
template_data:
enable_session: false
input_type: xml
template_mode: blob
# base64 encoded template
template_source: e3sgLiB8IGpzb25NYXJzaGFsIH19
transform_response_headers:
- method: GET
path: /xml
add_headers:
Content-Type: "application/json"
act_on: false
delete_headers: [ ]
#curl http://localhost:8081/httpbin-transform/anything -X POST -d '{"foo": "bar"}' -H 'Content-Type: application/json'
# {
# "args": {},
# "data": "{\"bar\": \"bar\"}",
# "files": {},
# "form": {},
# "headers": {
# "Accept": "*/*",
# "Accept-Encoding": "gzip",
# "Content-Length": "14",
# "Content-Type": "application/json",
# "Host": "httpbin.org",
# "User-Agent": "curl/7.71.1",
# "X-Amzn-Trace-Id": "Root=1-5f7b9a0c-38521f504d5e3ff521049ce7"
# },
# "json": {
# "bar": "bar"
# },
# "method": "POST",
# "origin": "::1, 82.47.141.120",
# "url": "http://httpbin.org/anything"
# }