I have been working on simple RESTFul Web Services lately, with jersey on Eclipse. I can get the GET Functions to work just fine. But when I try POST Methods, using the Post annotation and deploy it, I get the "method not allowed" message. I can't seem to figure out why. Any idea on how I can get it to work?
Thank you.
Here is my Code:-
package myapp;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
@Path("login")
public class SimpleClass {
@POST
@Path("/sayhello")
@Produces("text/plain")
public String sayHello(@QueryParam("username") String username)
{
return "Hello "+username;
}
}
And accessed through the link as: http://localhost:8080/RestSample/login/sayhello?username=som
And I get the "method not allowed" message.