You need to sign in to do that
Don't have an account?
Mickey Stringer 5
REST GET with Multiple Parameters
I've seen many variations of this question, but none seem to provide the answer. I want to pass multiple parameters (different parameters, not different values of the same parameter) to the GET method of a RestResource class. I want to then retrieve each parameter and send them to the appropriate method for processing (each param goes to a different method, then the aggregate result is returned to the client). I'm currently going about this like so:
The issue I'm having is that only the first parameter is being grabbed.
My URL looks like this - apexrest/apiClass?param1=X¶m2=Y¶m3=Z
For every parameter after the first one I receive the error, "'param' is not recognized as an internal or external command, operable program or batch file." The variables set to the parameter values also remain null.
How can I accomplish this? I would like to pass all parameters very simply in the URL
param1Var = RestContext.request.params.get('param1'); param2Var = RestContext.request.params.get('param2'); param3Var = RestContext.request.params.get('param3');
The issue I'm having is that only the first parameter is being grabbed.
My URL looks like this - apexrest/apiClass?param1=X¶m2=Y¶m3=Z
For every parameter after the first one I receive the error, "'param' is not recognized as an internal or external command, operable program or batch file." The variables set to the parameter values also remain null.
How can I accomplish this? I would like to pass all parameters very simply in the URL
All Answers