It is very intuitive to do a return of the API with an object or something, but would like to return an object along with the status code of the request.
@Override
@GET
@Path("/{num}/{cod}")
public Foo getFoo(@PathParam("num") long numFoo, @PathParam("cod") long codFoo) {
Foo f = new Foo();
try {
f = fooDAO.buscarFoo(numFoo, codFoo);
} catch (SQLException e) {
e.printStackTrace();
}
return f;
}
This way I have the object return, but how do I return the object + status code http
to inform the result of the request?