> -----Original Message-----
> From: Sergey Beryozkin [mailto:[email protected]]
> Sent: Monday, March 13, 2017 3:21 AM
> To: [email protected]
> Subject: Re: Best way to handle a HEAD request as a heartbeat?
> 
> Sure, introduce a @Head resource method

Ok, what should this method do?  I currently have the following:
---------------
        @HEAD
        @Path("heartbeat")
        public String heartbeat() { return ""; }
---------------

But this results in a slightly annoying INFO message of:
----------------
.JAXRSOutInterceptor.serializeMessage Entity body returned by GET-supporting 
resource method will be dropped as HEAD was the actual http request method
----------------

So it's no harm done, but how do I make it return a HEAD response, but without 
an entity body?  Would I continue to declare it as returning a String, but 
return null?

> On 11/03/17 03:07, KARR, DAVID wrote:
> > I have a small REST service and a browser client to go with it.  The
> browser client has a "heartbeat" service that just sends a HEAD request,
> just to verify the service is available.  However, I noticed that I'm
> seeing a message in the log saying that my HEAD request is being
> translated to a GET request, likely because I don't have a handler
> method for it.
> >
> > As my HEAD request handler just has to return a 200, what is the
> simplest way to define this method?
> >

Reply via email to