Bootstrap FreeKB - Broadcom API Gateway - ${request.url.query} variable
Broadcom API Gateway - ${request.url.query} variable

Updated:   |  Broadcom API Gateway articles

Certain variables are built into the API Gateway. One such variable is ${request.url.query}. To demonstrate how this variable is commonly used, I setup http://www.freekb.net/Stage1 to return the value stored in the "foo" key, like this.

 

  1. In the Policy Manager, select Publish Web API to create a REST service
  2. Give your service a unique name, such as myService.
  3. Target URL = The URL that requests will route out to (outbound), which would be http://www.freekb.net/Stage1${request.url.query} in this example
  4. Gateway URL = The context root of the URL that requests will route into (inbound), such as /example
  5. Select Finish.

You can now get http://www.freekb.net/Stage1${request.url.query} through the API Gateway. Let's say your API Gateway is configured with https://api.example.com. Since you defined /example as the endpoint for myService, you would use https://api.example.com/example to route requests through the API Gateway and onto http://www.freekb.net/Stage1${request.url.query}. To put this another way, in this example, https://api.example.com/example is the inbound URL and http://www.freekb.net/Stage1${request.url.query} is the outbound URL.

  • Inbound URL = https://api.example.com/example?foo=bar
  • Outbound URL = http://www.freekb.net/Stage1/?foo=bar

You should get the following.

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter e72a2a in the box below so that we can be sure you are a human.