Hello All,
Does anyone else have this issue? In my JavaScript callout, I have the following three lines:
print("request.formparam.names: " + context.getVariable("request.formparam.names")); print(" request.formparam.bobo: " + context.getVariable("request.formparam.bobo")); print("request.formparam.count: " + context.getVariable("request.formparam.count"));
I am using POSTMAN and created a POST request where the only form parameter "bobo" is set to the value of "steve". When I run this through Apigee and watch the debugger, I get:
request.formparam.names: null request.formparam.bobo: steve request.formparam.count: null
"request.formparam.names" should be "[bobo]", request.formparam.count should be "1". Is anyone else experiencing this issue, or am I going crazy?
TIA, Steve
Solved! Go to Solution.
ah, its a doc bug, the correct variable name is 'request.formparams.names' and 'request.formparams.count'
and for accessing individual variables you would use request.formparam.{paramname}
Thanks for reporting @Stephan.Cossette
fyi, @Floyd Jones
Hi Anil,
Thanks for the quick response, but I think you may be confused on the usage of these variables...
You can refer to "http://apigee.com/docs/api-services/reference/vari..." for these built ins... but this one should function like "request.header.names" & "request.header.count" and "request.queryparam.names" & "request.queryparams.count" -- these other two similar references *work correctly*.
You are explicitly assigning these values and that defeats the purpose of the built-ins.
I did however change the header "Content-Type : application/x-www-form-urlencoded", and it is still not working.
Thanks! Steve
Ahhh, I got it now... Yes, It seems like a bug. I can able to reproduce same. Great finding. We will let respective team know about this issue. We will keep you updated on same.
ah, its a doc bug, the correct variable name is 'request.formparams.names' and 'request.formparams.count'
and for accessing individual variables you would use request.formparam.{paramname}
Thanks for reporting @Stephan.Cossette
fyi, @Floyd Jones
Docs updated. Thanks!
Awesome, Thank you @Floyd Jones
Hello Anil ,
Any Update on the Above issue...??
the correct variable name is 'request.formparams.names' and 'request.formparams.count'
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |