Why proxy.pathsuffix is not getting populated in Proxy flow even though client sent?

I see proxy proxy.pathsuffix value showing blank. How to get that populated?

0 3 898
3 REPLIES 3

@skammili ,weatherinfo-rev1-2016-02-09.zip

It works as expected in Apigee cloud, Please see proxy.pathsuffix variable explanation below from docs here,

The value of API proxy basepath suffix that is sent from the client and received at the ProxyEndpoint.

The basepath is defined as the path component that uniquely identifies the API proxy. The public-facing URL of an API proxy is comprised of your organization name, the environment where the proxy is deployed, the basepath, the basepath suffix, and any query parameters. 

For Example,

If, Your target endpoint is,

http://weather.yahooapis.com

Proxy Base path is,

/weatherinfo

If, Your Proxy API is

http://asagarnodeapp-test.apigee.net/weatherinfo/forecastrss?w=12797282

Then, you will see proxy.pathsuffix variable value as "/forecastrss"

If your target endpoint is http://weather.yahooapis.com/forecastrss , If your proxy base path is "/weatherinfo", If your API call is http://asagarnodeapp-test.apigee.net/weatherinfo?w=12797282 then your proxy.pathsuffix variable value will be empty.

Find attached proxy which prints proxy.pathsuffix in transaction log trace window,

1908-screen-shot-2016-02-09-at-52031-pm.png

<PreFlow name="PreFlow">
<Request>
<Step>
<Name>JSC.Test</Name>
</Step>
</Request>
<Response/>
</PreFlow>

my js content 

print(context.getVariable("proxy.pathsuffix"));
print('proxy.pathsuffix', context.getVariable('proxy.pathsuffix'));

but output is

proxy.pathsuffix

getting empty value

 

please ask a new question, rather than posting a comment to a 7-year old question that has been answered.

Click the button at the top of the screen.

ask-a-question.png