Returning other than HTTP status 200?

7 views
Skip to first unread message

Rick Mann

unread,
Oct 6, 2016, 10:57:03 PM10/6/16
to Baratine
I may be blind, but I see no obvious way of returning something other than a 200 status code (say, 404 not found or 201 created).

Little help? This is in the context of a REST service.

Alex Rojkov

unread,
Oct 6, 2016, 11:30:18 PM10/6/16
to Rick Mann, Baratine
Try with request.status(..)

@Get
public void create(RequestWeb request) {
request.status(HttpStatus.CREATED);

request.ok("hello world");
}
Reply all
Reply to author
Forward
0 new messages