Examples of headers()


Examples of org.jboss.netty.handler.codec.http.HttpResponse.headers()

        } else {
            // we cannot throw the exception here
            LOG.warn("HttpServerChannelHandler is not found as attachment to handle exception, send 404 back to the client.", e.getCause());
            // Now we just send 404 back to the client
            HttpResponse response = new DefaultHttpResponse(HTTP_1_1, NOT_FOUND);
            response.headers().set(Exchange.CONTENT_TYPE, "text/plain");
            response.headers().set(Exchange.CONTENT_LENGTH, 0);
            // Here we don't want to expose the exception detail to the client
            response.setContent(ChannelBuffers.copiedBuffer(new byte[]{}));
            ctx.getChannel().write(response);
        }
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.HttpResponse.headers()

            // we cannot throw the exception here
            LOG.warn("HttpServerChannelHandler is not found as attachment to handle exception, send 404 back to the client.", e.getCause());
            // Now we just send 404 back to the client
            HttpResponse response = new DefaultHttpResponse(HTTP_1_1, NOT_FOUND);
            response.headers().set(Exchange.CONTENT_TYPE, "text/plain");
            response.headers().set(Exchange.CONTENT_LENGTH, 0);
            // Here we don't want to expose the exception detail to the client
            response.setContent(ChannelBuffers.copiedBuffer(new byte[]{}));
            ctx.getChannel().write(response);
        }
    }
View Full Code Here

Examples of org.jclouds.openstack.swift.v1.domain.SwiftObject.headers()

      if (object == null) {
         return null;
      }
      Blob blob = new BlobImpl(toBlobMetadata(container).apply(object));
      blob.setPayload(object.payload());
      blob.setAllHeaders(object.headers());
      return blob;
   }

   @Override
   public void removeBlob(String container, String name) {
View Full Code Here

Examples of org.springframework.test.web.servlet.request.MockHttpServletRequestBuilder.headers()

      @Override
      public ClientHttpResponse executeInternal() throws IOException {
        try {
          MockHttpServletRequestBuilder requestBuilder = request(httpMethod, uri.toString());
          requestBuilder.content(getBodyAsBytes());
          requestBuilder.headers(getHeaders());

          MvcResult mvcResult = MockMvcClientHttpRequestFactory.this.mockMvc.perform(requestBuilder).andReturn();

          MockHttpServletResponse servletResponse = mvcResult.getResponse();
          HttpStatus status = HttpStatus.valueOf(servletResponse.getStatus());
View Full Code Here

Examples of org.springframework.web.bind.annotation.RequestMapping.headers()

        if (modeKeys.length == 0 || params.length == 0) {
          registerHandlerType = !detectHandlerMethods(handlerType, beanName, mapping);
        }
        if (registerHandlerType) {
          AbstractParameterMappingPredicate predicate = new TypeLevelMappingPredicate(
              params, mapping.headers(), mapping.method());
          for (String modeKey : modeKeys) {
            registerHandler(new PortletMode(modeKey), beanName, predicate);
          }
        }
      }
View Full Code Here

Examples of org.vertx.java.core.http.HttpClientRequest.headers()

    String filename = "upload/upload.txt";

    // For a non-chunked upload you need to specify size of upload up-front
    try {
      req.headers().set("Content-Length", String.valueOf(Files.size(Paths.get(filename))));

      // For a chunked upload you don't need to specify size, just do:
      // req.setChunked(true);

      vertx.fileSystem().open(filename, new AsyncResultHandler<AsyncFile>() {
View Full Code Here

Examples of org.vertx.java.core.http.HttpServerRequest.headers()

  public void handle(final ClientData clientData) {
    final HttpServerRequest request = clientData.getRequest();
    final Settings settings = manager.getSettings();

    log.trace("In handshake handler");
    MultiMap reqHeaders = request.headers();
    final MultiMap resHeaders = request.response().headers();
    String reqOrigin = reqHeaders.get("Origin");
    resHeaders.add("CONTENT_TYPE", "text/plain; charset=UTF-8");

    if (!this.verifyOrigin(reqOrigin)) {
View Full Code Here

Examples of org.vertx.java.core.http.HttpServerResponse.headers()

      super.handleRequest();
    } else {
      final Buffer buffer = new Buffer(0);
      final HttpServerResponse res = request.response();
      String origin = request.headers().get("ORIGIN");
      MultiMap resHeaders = res.headers();
      resHeaders.add("Content-Length", String.valueOf(1));
      resHeaders.add("Content-Type", "text/plain; charset=UTF-8");

      if (origin != null) {
        // https://developer.mozilla.org/En/HTTP_Access_Control
View Full Code Here

Examples of play.mvc.Http.Request.headers()

  }

  public static void beforeActionInvocation(Context ctx, Method actionMethod) {
    Request request = ctx.request();
    play.mvc.Http.Flash flash = ctx.flash();
    Map<String, String[]> headers = request.headers();

    String property = dumpRequest;
    if (property != null && property.length() > 0) {
      if (!"false".equals(property) && !"no".equals(property)) {
        if ("yes".equals(property) || "true".equals(property)) {
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.