Skip to main content
Missing single quote, and being that I needed a few more chars in edit, I cleaned up the opening
Source Link

ConsiderIf you want to test belowthe REST API below:

@RestResource (urlMapping='/wte/test/*') global class WTE_SampleRESTService { @HttpGet global static void doGet() { String id = RestContext.request.params.get('id'id'); System.debug('ID: '+ id); } @HttpPost global static void doPost(String id, String name) { System.debug('ID: '+id+', Name: '+name); } } 

You can use Workbench or curl.

enter image description here

above image shows Testing using Workbench

This post might be very helpful for you.

Consider you want to test below REST API

@RestResource (urlMapping='/wte/test/*') global class WTE_SampleRESTService { @HttpGet global static void doGet() { String id = RestContext.request.params.get('id); System.debug('ID: '+ id); } @HttpPost global static void doPost(String id, String name) { System.debug('ID: '+id+', Name: '+name); } } 

You can use Workbench or curl.

enter image description here

above image shows Testing using Workbench

This post might be very helpful for you.

If you want to test the REST API below:

@RestResource (urlMapping='/wte/test/*') global class WTE_SampleRESTService { @HttpGet global static void doGet() { String id = RestContext.request.params.get('id'); System.debug('ID: '+ id); } @HttpPost global static void doPost(String id, String name) { System.debug('ID: '+id+', Name: '+name); } } 

You can use Workbench or curl.

enter image description here

above image shows Testing using Workbench

This post might be very helpful for you.

Source Link
Jitendra Zaa
  • 3.1k
  • 21
  • 27

Consider you want to test below REST API

@RestResource (urlMapping='/wte/test/*') global class WTE_SampleRESTService { @HttpGet global static void doGet() { String id = RestContext.request.params.get('id); System.debug('ID: '+ id); } @HttpPost global static void doPost(String id, String name) { System.debug('ID: '+id+', Name: '+name); } } 

You can use Workbench or curl.

enter image description here

above image shows Testing using Workbench

This post might be very helpful for you.