Package ratpack.http

Examples of ratpack.http.Response.status()


    context.lastModified(date, new Runnable() {
      public void run() {
        final String ifNoneMatch = context.getRequest().getHeaders().get(HttpHeaders.Names.IF_NONE_MATCH);
        Response response = context.getResponse();
        if (ifNoneMatch != null && ifNoneMatch.trim().equals("*")) {
          response.status(NOT_MODIFIED.code()).send();
          return;
        }

        if (!response.getHeaders().contains(HttpHeaders.Names.CONTENT_TYPE)) {
          String contentType = context.get(MimeTypes.class).getContentType(file.getFileName().toString());
View Full Code Here


    if (requestMethod.name(method)) {
      context.next();
    } else if (requestMethod.isOptions()) {
      Response response = context.getResponse();
      response.getHeaders().add(HttpHeaderConstants.ALLOW, method);
      response.status(200).send();
    } else {
      context.clientError(405);
    }
  }
}
View Full Code Here

        description.append(")");
        String message = description.toString();
        LOGGER.warn(message);

        response.status(500);

        if (launchConfig.isDevelopment()) {
          response.send(message);
        } else {
          response.send();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.