1
1
<?xml version =" 1.0" encoding =" UTF-8" standalone =" yes" ?>
2
2
<ProxyEndpoint name =" default" >
3
- <Description />
3
+ <Description >demonstrates how to use ExtractVariables to extract a value from a query parameter.</Description >
4
+ <HTTPProxyConnection >
5
+ <BasePath >/samplet-extract-variables</BasePath >
6
+ <VirtualHost >secure</VirtualHost >
7
+ </HTTPProxyConnection >
8
+
4
9
<PreFlow name =" PreFlow" >
5
- <Request />
6
- <Response />
10
+ <Request />
11
+ <Response >
12
+ <Step >
13
+ <Name >AM-Remove-Inbound-Headers</Name >
14
+ </Step >
15
+ </Response >
7
16
</PreFlow >
17
+
8
18
<Flows >
9
- <Flow name =" Extract URI Path" >
10
- <Description >Use the Extract Variables policy to parse the request URL</Description >
11
- <Request >
12
- <Step >
13
- <Name >Extract-Path-Component</Name >
14
- </Step >
15
- <Step >
16
- <Name >ReadURIPath</Name >
17
- </Step >
18
- </Request >
19
- <Response />
20
- <Condition >(proxy.pathsuffix MatchesPath "/resource1/{id}") and (request.verb = "GET")</Condition >
21
- </Flow >
22
- <Flow name =" Extract Query Param" >
23
- <Description >Use the Extract Variables policy to parse the request URL</Description >
24
- <Request >
25
- <Step >
26
- <Name >Extract-Query-Param</Name >
27
- </Step >
28
- <Step >
29
- <Name >ReadQueryParam</Name >
30
- </Step >
31
- </Request >
32
- <Response />
33
- <Condition >(request.queryparam.code.values.count = 1) and (request.verb = "GET")</Condition >
34
- </Flow >
19
+ <Flow name =" Extract URI Path" >
20
+ <Description >Use the Extract Variables policy to parse the request URL</Description >
21
+ <Request >
22
+ <Step >
23
+ <Name >EV-Path-Component</Name >
24
+ </Step >
25
+ <Step >
26
+ <Name >JS-Produce-Response-for-Read-URI-Path</Name >
27
+ </Step >
28
+ </Request >
29
+ <Response />
30
+ <Condition >(proxy.pathsuffix MatchesPath "/resource1/{id}") and (request.verb = "GET")</Condition >
31
+ </Flow >
32
+
33
+ <Flow name =" Extract Query Param" >
34
+ <Description >Use the Extract Variables policy to parse the request URL</Description >
35
+ <Request >
36
+ <Step >
37
+ <Name >RF-Invalid-Query-Param</Name >
38
+ <Condition >NOT (request.queryparam.code.values.count = 1)</Condition >
39
+ </Step >
40
+ <Step >
41
+ <Name >EV-Query-Param</Name >
42
+ </Step >
43
+ </Request >
44
+ <Response >
45
+ <Step >
46
+ <Name >JS-Produce-Response-for-Read-Query-Param</Name >
47
+ </Step >
48
+ </Response >
49
+ <Condition >(proxy.pathsuffix = "") and (request.verb = "GET")</Condition >
50
+ </Flow >
51
+
52
+ <Flow name =" unknown-request" >
53
+ <Request >
54
+ <Step >
55
+ <Name >RF-Unknown-Request</Name >
56
+ </Step >
57
+ </Request >
58
+ <Response />
59
+ </Flow >
60
+
35
61
</Flows >
62
+
36
63
<PostFlow name =" PostFlow" >
37
- <Request />
38
- <Response />
64
+ <Request />
65
+ <Response />
39
66
</PostFlow >
40
- <HTTPProxyConnection >
41
- <BasePath >/samplet-extract-variables</BasePath >
42
- <VirtualHost >default</VirtualHost >
43
- <VirtualHost >secure</VirtualHost >
44
- </HTTPProxyConnection >
45
67
<RouteRule name =" noroute" />
46
- </ProxyEndpoint >
68
+ </ProxyEndpoint >
0 commit comments