I am using Grizzly in a simple way to process HTTP GET requests for an
RSS Reader.
However I am trying to set the response status for different events.
Unfortunately this doesn't work.
public void service(final Request request, final Response response)
throws Exception {
if (!request.method().toString().equalsIgnoreCase("GET")) {
response.setStatus(HttpURLConnection.HTTP_BAD_METHOD);
response.finish();
return;
}
When this starts up and I send a POST request I expect a 405, but that
doesn't happen. What am I doing wrong?