String queryParameters = request.getQueryString();
if (queryParameters == null) {
queryParameters = "";
}
requestUri = absoluteUriBuilder.replacePath(requestURI).
replaceQuery(queryParameters).
build();
} catch (UriBuilderException ex) {
final Response.Status badRequest = Response.Status.BAD_REQUEST;
response.sendError(badRequest.getStatusCode(), badRequest.getReasonPhrase());