Examples of headers()


Examples of net.sf.sahi.response.HttpResponse.headers()

            logger.fine("Returning process401");
          }
          response = process401(connection, inputStreamFromHost);
        }else {
          response = getResponse(inputStreamFromHost, connection);
          TrafficLogger.storeResponseHeader(response.headers().toString().getBytes(), "unmodified");
          TrafficLogger.storeResponseBody(response.data(), "unmodified");
        }
       
        if (requestFromBrowser.isAjax() && responseCode > 300 && responseCode < 308){
          String redirectedTo = response.getLastSetValueOfHeader("Location");
View Full Code Here

Examples of org.apache.cxf.jaxrs.client.Client.headers()

           
            if (stateCanBeChanged) {
                Client c = WebClient.client(proxy);
                MultivaluedMap<String, String> map = c.getHeaders();
                map.putSingle("CustomHeader", actualHeaderName);
                c.headers(map);
                proxy.echoBookNameAndHeader2(actualBookName);
                verifyResponse(c.getResponse(), actualBookName, actualHeaderName);
            } else {
                verifyResponse(proxy.echoBookNameAndHeader(actualHeaderName, actualBookName),
                               actualBookName, actualHeaderName);
View Full Code Here

Examples of org.apache.cxf.jaxrs.client.WebClient.headers()

                LOG.trace("Request body = " + body);
            }
        }

        // set headers
        client.headers(binding.bindCamelHeadersToRequestHeaders(inMessage.getHeaders(), exchange));

        // invoke the client
        Object response = null;
        if (responseClass == null || Response.class.equals(responseClass)) {
            response = client.invoke(httpMethod, body);
View Full Code Here

Examples of org.apache.james.mailbox.MessageResult.headers()

                        MessageResult result = results.next();

                        WritableByteChannel outChannel = Channels.newChannel(extraDotOut);

                        // write headers
                        Iterator<Header> headers = result.headers();
                        while (headers.hasNext()) {
                            headers.next().writeTo(outChannel);

                            // we need to write out the CRLF after each header
                            extraDotOut.write("\r\n".getBytes());
View Full Code Here

Examples of org.atmosphere.cpr.AtmosphereResponse.headers()

    protected Action info(AtmosphereResource r) {
        final AtmosphereResponse response = r.getResponse();
        final AtmosphereRequest request = r.getRequest();

        response.headers().put("Content-Type", "application/json; charset=UTF-8");
        ObjectNode json = new ObjectNode(JsonNodeFactory.instance);
        json.put("websocket", supportWebSocket);
        json.putArray("origins").add("*:*");
        json.put("entropy", new Random().nextInt());
        r.write(JsonCodec.encode(json));
View Full Code Here

Examples of org.eclipse.jetty.spdy.api.Stream.headers()

    @Test(expected = IllegalStateException.class)
    public void testSendHeadersAfterCloseIsIllegal() throws Exception
    {
        Session session = startClient(startServer(null), null);
        Stream stream = session.syn(new SynInfo(5, TimeUnit.SECONDS, new Fields(), true, (byte)0), null);
        stream.headers(new HeadersInfo(new Fields(), true));
    }

    @Test //TODO: throws an ISException in StandardStream.updateCloseState(). But instead we should send a rst or something to the server probably?!
    public void testServerClosesStreamTwice() throws Exception
    {
View Full Code Here

Examples of org.glassfish.jersey.server.ContainerRequest.headers()

        try {
            final ContainerRequest requestContext = new ContainerRequest(baseUri, request.absoluteURI(),
                    request.method(), getSecurityContext(request), new MapPropertiesDelegate());

            for (final String headerName : request.headers().names()) {
                requestContext.headers(headerName, request.headers().get(headerName));
            }
            requestContext.setWriter(responseWriter);
            requestContext.setRequestScopedInitializer(new RequestScopedInitializer() {
                @Override
                public void initialize(final ServiceLocator locator) {
View Full Code Here

Examples of org.jboss.aerogear.io.netty.handler.codec.sockjs.handler.CorsMetadata.headers()

    @Test
    public void nullObjects() {
        final CorsMetadata md = new CorsMetadata(null, null);
        assertThat(md.origin(), equalTo("*"));
        assertThat(md.headers(), is(nullValue()));
        assertThat(md.hasHeaders(), is(false));
    }

    @Test
    public void nullOriginString() {
View Full Code Here

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

                String headerValue = tc.convertTo(String.class, it.next());

                if (headerValue != null && headerFilterStrategy != null
                        && !headerFilterStrategy.applyFilterToCamelHeaders(key, headerValue, message.getExchange())) {
                    LOG.trace("HTTP-Header: {}={}", key, headerValue);
                    request.headers().add(key, headerValue);
                }
            }
        }

        Object body = message.getBody();
View Full Code Here

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

            }
            if (buffer != null) {
                request.setContent(buffer);
                int len = buffer.readableBytes();
                // set content-length
                request.headers().set(HttpHeaders.Names.CONTENT_LENGTH, len);
                LOG.trace("Content-Length: {}", len);
            } else {
                // we do not support this kind of body
                throw new NoTypeConversionAvailableException(body, ChannelBuffer.class);
            }
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.