Example usage for io.netty.handler.codec.http HttpMethod DELETE

List of usage examples for io.netty.handler.codec.http HttpMethod DELETE

Introduction

In this page you can find the example usage for io.netty.handler.codec.http HttpMethod DELETE.

Prototype

HttpMethod DELETE

To view the source code for io.netty.handler.codec.http HttpMethod DELETE.

Click Source Link

Document

The DELETE method requests that the origin server delete the resource identified by the Request-URI.

Usage

From source file:discord4j.rest.route.Route.java

License:Open Source License

public static <T> Route<T> delete(String uri, Class<T> responseType) {
    return new Route<>(HttpMethod.DELETE, uri, responseType);
}

From source file:edumsg.netty.EduMsgNettyServerInitializer.java

License:Open Source License

@Override
protected void initChannel(SocketChannel arg0) {
    CorsConfig corsConfig = CorsConfig.withAnyOrigin()
            .allowedRequestHeaders("X-Requested-With", "Content-Type", "Content-Length")
            .allowedRequestMethods(HttpMethod.GET, HttpMethod.POST, HttpMethod.PUT, HttpMethod.DELETE,
                    HttpMethod.OPTIONS)/*from  ww w .j a  v  a2 s.  c om*/
            .build();
    ChannelPipeline p = arg0.pipeline();
    if (sslCtx != null) {
        p.addLast(sslCtx.newHandler(arg0.alloc()));
    }
    p.addLast("decoder", new HttpRequestDecoder());
    p.addLast("encoder", new HttpResponseEncoder());
    p.addLast(new CorsHandler(corsConfig));
    p.addLast(new EduMsgNettyServerHandler());
}

From source file:godfinger.http.HttpServerInitializer.java

License:Apache License

@Override
public void initChannel(SocketChannel channel) {
    CorsConfig corsConfig = CorsConfig.withAnyOrigin().allowCredentials()
            .allowedRequestMethods(HttpMethod.GET, HttpMethod.POST, HttpMethod.PUT, HttpMethod.DELETE)
            .allowedRequestHeaders("accept", "content-type", "session-id").build();

    ChannelPipeline pipeline = channel.pipeline();
    pipeline.addLast(new HttpServerCodec());
    pipeline.addLast(new FaviconHandler());
    pipeline.addLast(new CorsHandler(corsConfig));
    pipeline.addLast(new HttpObjectAggregator(1024 * 1024));
    pipeline.addLast(new HttpRequestHandler(requestProcessor));
}

From source file:io.advantageous.conekt.http.impl.HttpClientImpl.java

License:Open Source License

@Override
public HttpClientRequest delete(int port, String host, String requestURI) {
    return request(io.advantageous.conekt.http.HttpMethod.DELETE, port, host, requestURI);
}

From source file:io.advantageous.conekt.http.impl.HttpClientImpl.java

License:Open Source License

@Override
public HttpClientRequest delete(int port, String host, String requestURI,
        Handler<HttpClientResponse> responseHandler) {
    return request(io.advantageous.conekt.http.HttpMethod.DELETE, port, host, requestURI, responseHandler);
}

From source file:io.advantageous.conekt.http.impl.HttpClientImpl.java

License:Open Source License

@Override
public HttpClientRequest delete(String requestURI) {
    return request(io.advantageous.conekt.http.HttpMethod.DELETE, requestURI);
}

From source file:io.advantageous.conekt.http.impl.HttpClientImpl.java

License:Open Source License

@Override
public HttpClientRequest delete(String requestURI, Handler<HttpClientResponse> responseHandler) {
    return request(io.advantageous.conekt.http.HttpMethod.DELETE, requestURI, responseHandler);
}

From source file:io.advantageous.conekt.http.impl.HttpClientImpl.java

License:Open Source License

@Override
public HttpClientRequest deleteAbs(String absoluteURI) {
    return requestAbs(io.advantageous.conekt.http.HttpMethod.DELETE, absoluteURI);
}

From source file:io.advantageous.conekt.http.impl.HttpClientImpl.java

License:Open Source License

@Override
public HttpClientRequest deleteAbs(String absoluteURI, Handler<HttpClientResponse> responseHandler) {
    return requestAbs(io.advantageous.conekt.http.HttpMethod.DELETE, absoluteURI, responseHandler);
}

From source file:io.advantageous.conekt.http.impl.HttpClientRequestImpl.java

License:Open Source License

private HttpMethod toNettyHttpMethod(io.advantageous.conekt.http.HttpMethod method) {
    switch (method) {
    case CONNECT: {
        return HttpMethod.CONNECT;
    }/*from www .j  av a2  s.  c om*/
    case GET: {
        return HttpMethod.GET;
    }
    case PUT: {
        return HttpMethod.PUT;
    }
    case POST: {
        return HttpMethod.POST;
    }
    case DELETE: {
        return HttpMethod.DELETE;
    }
    case HEAD: {
        return HttpMethod.HEAD;
    }
    case OPTIONS: {
        return HttpMethod.OPTIONS;
    }
    case TRACE: {
        return HttpMethod.TRACE;
    }
    case PATCH: {
        return HttpMethod.PATCH;
    }
    default:
        throw new IllegalArgumentException();
    }
}