Hi Michael,
If your API is invoked with /users/steve
for example, request.parameters.user
would have a value of steve
. A shorthand for request.parameters.user
is {user}
so in your invoke policy
$(host-url)/users/{user}
or
$(host-url)/users/$(request.parameters.user)
would have a target url of something like https://hostname:port/users/steve
Best Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
------------------------------
Original Message:
Sent: Mon January 09, 2023 03:18 AM
From: Michael Emil Rivera
Subject: Get the value of path parameter and pass it to invoke URL
Hello! I would like to ask how you can get the value of a declared path parameter and pass it to the invoke URL in Gateway Policy.
For example, I created a GET operation with a path
/users/{user}
wherein {user} is the declared parameter located in the path. Is it possible that when the APIC endpoint is invoked it will get the value of {user} from that endpoint and pass it on to the URL such that it will be invoked in our microservice as
$(host-url)/users/{user}
Appreciate any help you can extend!
------------------------------
Best regards,
Michael Emil Rivera
------------------------------