proxy.pathsuffix value empty

<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

0 1 50
1 REPLY 1

Answer these 2 questions:

  1. what is the BasePath on your proxyendpoint?
  2. what path did you send in to the API proxy?

At runtime, the proxy.pathsuffix variable will hold everything in the path that appears to the right of the basepath. If you send in a request with "just the basepath" then we would expect the proxy.pathsuffix to be blank - the empty string. Maybe that is what you are seeing.

Example

  • The BasePath element in the ProxyEndpoint is /base
  • Send in a request like GET /base . The proxy.pathsuffix variable holds the empty string.
  • Send in a request like GET /base/1 . The proxy.pathsuffix variable holds "/1" .