Java Code Examples for io.netty.handler.codec.http.HttpResponseStatus#TEMPORARY_REDIRECT

The following examples show how to use io.netty.handler.codec.http.HttpResponseStatus#TEMPORARY_REDIRECT . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: mesos-rxjava   File:    License: Apache License 2.0 5 votes vote down vote up
public void testGetUriFromRedirectResponse() throws Exception {
    final URI mesosUri = URI.create("");
    final DefaultHttpResponse nettyResponse = new DefaultHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.TEMPORARY_REDIRECT);
    nettyResponse.headers().add("Location", "//");
    final HttpClientResponse<ByteBuf> response = new HttpClientResponse<>(
        UnicastContentSubject.create(1000, TimeUnit.MILLISECONDS)
    final URI uri = MesosClient.getUriFromRedirectResponse(mesosUri, response);
Example 2
Source Project: crate   File:    License: Apache License 2.0 4 votes vote down vote up
public static FullHttpResponse redirectTo(String location) {
    var response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.TEMPORARY_REDIRECT);
    response.headers().add(HttpHeaderNames.LOCATION, location);
    HttpUtil.setContentLength(response, 0);
    return response;