I have a rest endpoint like this
@Path("/keys")
public class KeysResource {
keyService my_keyService = new keyService();
/**
* Check if the API is alive
* @return 204 on existing API, else the framework returns 404.
*/
@HEAD
public Response head() {
return my_keyService.head();
}
And I have the keyService class like this
public Response head() {
return Response.status(Status.NO_CONTENT).build();
//I want to have a function like this
keyInfo.getKeyInfo();
}
So in the service class, I want to have a function to get the request and response information when users calling this API. How can I get the information from the service class??