use of org.apache.tapestry5.services.HttpStatus in project tapestry-5 by apache.
the class Index method onHttpPut.
@RestInfo(consumes = "application/json")
public Object onHttpPut(@RequestBody User user) throws UnsupportedEncodingException {
HttpStatus status;
if (!USERS.contains(user)) {
USERS.add(user);
status = HttpStatus.created();
} else {
status = HttpStatus.ok();
}
return status.withContentLocation(pageRenderLinkSource.createPageRenderLinkWithContext(Index.class, user.getEmail()));
}
Aggregations