To write REST Get/post method, you need to create a JAVA Sling Servlet.
// Here is the example for this.
Here we are submitting data to POST method via AJAX call:-
Here URL is the path for request.
If you want to integrate or invoke 3rd party restful web service, see this
// Creating Adobe Experience Manager bundles that invoke third party Restful web services
I hope this would help you.
Can you share the example of custom JAVA Sling Servlet using the GET method where the data is entered by the author using the classic dialog is return in json format when the rest api get method request is made.