Hi.
I'm trying to use a header value to route between different target-url's in a yaml file.
My question here is, do I need to either define this as a variable (color) or do I need to retrieve the value and set it to a variable to use in this switch statement? The reason I ask, is when testing this, if I pass a header (color) and set the value to say blue, it's hitting my otherwise section... which leads me to believe it has a null value.
execute:
- switch:
version: 2.0.0
title: switch
case:
- condition: ($header(color) = blue)
execute:
- invoke:
version: 2.3.0
title: blue invoke
timeout: 60
verb: keep
chunked-uploads: false
persistent-connection: true
cache-response: protocol
cache-ttl: 900
target-url: $(olb-odc-blue-url)/$(api.operation.path)$(request.search)
tls-profile: paastlsprofile:1.0.0
- condition: ($header(color) = green)
execute:
- invoke:
version: 2.3.0
------------------------------
Jeff Bennett
------------------------------