read request path parameters from javascript object model

Hi there,

How can read request path parameters from APIGEE proxy context.proxyRequest ?

var request = context.proxyRequest;

I am able to read query params by request.queryParams. how can read path parameters ?

I need to read a path parameter from url, example : /test/test/{id}.

Is there a way like request.pathParams ? does it possible ? or We need to use substring operation to read the path parameters from URL ?

Thanks.

0 4 1,664
4 REPLIES 4

Hi @GopiMolabanti ,

you can use proxy.pathsuffix in the JS to get the request path.

Thanks @Ravindra Singh for helping.

is there any way we can get all path parameters as a list or Map ?


you can split the value of proxy.pathsuffix to get the list in array.

Not applicable

To be honest, I do not understand completely. It reminds me of broken button at www.paidpaper.net when I read review of essaybox there. Thankfully they fixed this bug. I would appreciative any detailed description.