Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass JSON String to Jersey Rest Web-Service with Post Request

Tags:

I want to create a REST Jersey Web-Service accepting JSON string as input parameter.

Also I will use post requestand from webmethod I will return one JSON string.

How can I consume this in a HTML page using Ajax post request. I want to know what all changes I need to make it on web method to accept JSON String.

 public class Hello {

      @POST
     public String sayPlainTextHello() {
      return "Hello Jersey";
      }
   }