0
It’s quite intuitive to make a return of the API with an object or something like that, only you would like to make the return of 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 return of the object, but how to return the object + the status code http
to inform the result of the request?
Simple and objective. + 1
– Hamurabi Araujo