Hi David
On 20/03/17 20:10, KARR, DAVID wrote:
-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]]
Sent: Sunday, March 19, 2017 2:49 PM
To: [email protected]
Subject: Re: Best way to handle a HEAD request as a heartbeat?

It should return JAXRS Response with no entity set.

Would it just be this then?
---------------
        @HEAD
        @Path("heartbeat")
        public Response heartbeat() { return Response.ok().build(); }
---------------


Exactly

Cheers, Sergey
On 18/03/17 21:17, KARR, DAVID wrote:
-----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?




--
Sergey Beryozkin

Talend Community Coders
https://urldefense.proofpoint.com/v2/url?u=http-
3A__coders.talend.com_&d=DwIC-g&c=LFYZ-o9_HUMeMTSQicvjIg&r=OsTemSXEn-
xy2uk0vYF_EA&m=vlSJfA5YntS-GC5I_ANxodJX5IxL53pkaId_uGZ6yJo&s=YF9-
GKXDkKHIAZ6M0WUxWmyXlo_iEHEHInsgiomZA2Q&e=


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Reply via email to