URL Parameters in RESTlet for POST Method
Hi All,
Is there any way to get the URL parameters inside the POST method of a SuiteScript 2.0 RESTlet.
I’d like to to create a gateway type endpoint and use the URL parameters to determine which handler code to execute to deal with the request.
e.g. {{URL}}&type=customer ==> Invoke customer POST handler.
I appreciate that I could do this via multiple RESTlets or using the data in the POST body but the approach I’m aiming for is more like what you might typically see with an API.
Thanks,
Chris
Use context.request.parameters.your_url_parameter
so for your example it would be context.request.parameters.type
I think that’s only available in Suitelets?
There’s an equivalent requestParams in the RESTlet GET method but nothing that seems to be available in POST.
Ok for RESTlets its just context.param or specific to your example it would be context.type
Thanks ebarro but that doesn’t get me URL parameters in the case of a POST request.



