Skip to main content
2 of 2
added 51 characters in body
Keith C
  • 138.3k
  • 31
  • 233
  • 476

Rather than accept say form encoded parameters it is usually more convenient (for the client and in the Apex code) to accept a JSON string that holds the parameters. For the POST case:

@HttpPost global static Result post() { String jsonString = RestContext.request.requestBody.toString(); // Use Apex JSON class to parse ... } 

For GET parameters you have to do your own string manipulation of the URL that you can obtain from the static field RestContext.request.requestURI. (Or better use params as Jitendra illustrates.)

Keith C
  • 138.3k
  • 31
  • 233
  • 476