Package io.netty.handler.codec.http

Examples of io.netty.handler.codec.http.HttpResponseStatus


    }

    private static FullHttpResponse createHttpResponse(int spdyVersion, SpdyHeaderBlock responseFrame)
            throws Exception {
        // Create the first line of the response from the name/value pairs
        HttpResponseStatus status = SpdyHeaders.getStatus(spdyVersion, responseFrame);
        HttpVersion version = SpdyHeaders.getVersion(spdyVersion, responseFrame);
        SpdyHeaders.removeStatus(spdyVersion, responseFrame);
        SpdyHeaders.removeVersion(spdyVersion, responseFrame);

        FullHttpResponse res = new DefaultFullHttpResponse(version, status);
View Full Code Here


    @Override
    protected HttpMessage createMessage(String[] initialLine) throws Exception {
        return new DefaultHttpResponse(
                RtspVersions.valueOf(initialLine[0]),
                new HttpResponseStatus(Integer.valueOf(initialLine[1]), initialLine[2]));
    }
View Full Code Here

            return;
        }

        final File file = deduceFile(msg.getUri());

        final HttpResponseStatus status;
        final ByteBuf body;
        final String mediaType;
        if (file.exists()) {
            final ByteArrayOutputStream baos = new ByteArrayOutputStream();
            final FileInputStream fileInputStream = new FileInputStream(file);
View Full Code Here

    }

    @Test
    public void testRequestReplySequence() throws InterruptedException, ExecutionException, TimeoutException {
        HelloWorldClient client = new HelloWorldClient(DEFAULT_PORT); // The client is no different than hello world.
        HttpResponseStatus statusCode = client.sendHelloRequest().getStatus();
        Assert.assertEquals(HttpResponseStatus.OK, statusCode);
    }
View Full Code Here

    }

    @Test
    public void testRequestReplySequence() throws InterruptedException, ExecutionException, TimeoutException {
        HelloWorldClient client = new HelloWorldClient(DEFAULT_PORT); // The client is no different than hello world.
        HttpResponseStatus statusCode = client.sendHelloRequest().getStatus();
        Assert.assertEquals(HttpResponseStatus.OK, statusCode);
    }
View Full Code Here

    }

    @Test
    public void testRequestReplySequence() throws InterruptedException, ExecutionException, TimeoutException {
        HelloWorldClient client = new HelloWorldClient(DEFAULT_PORT);
        HttpResponseStatus statusCode = client.sendHelloRequest().getStatus();
        Assert.assertEquals(HttpResponseStatus.OK, statusCode);
    }
View Full Code Here

    }

    @Test
    public void testRequestReplySequence() throws Exception {
        SslHelloWorldClient client = new SslHelloWorldClient(DEFAULT_PORT);
        HttpResponseStatus responseStatus = client.sendHelloRequest();
        Assert.assertEquals(HttpResponseStatus.OK, responseStatus);
    }
View Full Code Here

    public HttpResponseStatus sendHelloRequest() throws Exception {
        HttpClient<ByteBuf, ByteBuf> rxClient = RxNetty.<ByteBuf, ByteBuf>newHttpClientBuilder("localhost", port)
                .withSslEngineFactory(DefaultFactories.trustAll())
                .build();

        HttpResponseStatus statusCode = rxClient.submit(HttpClientRequest.createGet("/hello"))
                                                .lift(FlatResponseOperator.<ByteBuf>flatResponse())
                                                .map(new Func1<ResponseHolder<ByteBuf>, ResponseHolder<ByteBuf>>() {
                                                    @Override
                                                    public ResponseHolder<ByteBuf> call(ResponseHolder<ByteBuf> holder) {
                                                        System.out.println(holder.getContent().toString(
View Full Code Here

     *            HTTP response returned from the server for the request sent by beginOpeningHandshake00().
     * @throws WebSocketHandshakeException
     */
    @Override
    protected void verify(FullHttpResponse response) {
        final HttpResponseStatus status = HttpResponseStatus.SWITCHING_PROTOCOLS;
        final HttpHeaders headers = response.headers();

        if (!response.getStatus().equals(status)) {
            throw new WebSocketHandshakeException("Invalid handshake response getStatus: " + response.getStatus());
        }
View Full Code Here

     *            HTTP response returned from the server for the request sent by beginOpeningHandshake00().
     * @throws WebSocketHandshakeException
     */
    @Override
    protected void verify(FullHttpResponse response) {
        final HttpResponseStatus status = HttpResponseStatus.SWITCHING_PROTOCOLS;
        final HttpHeaders headers = response.headers();

        if (!response.getStatus().equals(status)) {
            throw new WebSocketHandshakeException("Invalid handshake response getStatus: " + response.getStatus());
        }
View Full Code Here

TOP

Related Classes of io.netty.handler.codec.http.HttpResponseStatus

Copyright © 2018 www.massapicom. 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.