Interface HttpRequestContext.HttpResponseFactory

  • Enclosing interface:
    HttpRequestContext

    public static interface HttpRequestContext.HttpResponseFactory
    A factory to create HttpResponses.
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      io.netty.handler.codec.http.HttpResponse create​(io.netty.handler.codec.http.HttpResponseStatus status)
      Creates a new HttpResponse instance with the specified status.
      io.netty.handler.codec.http.FullHttpResponse createFull​(io.netty.handler.codec.http.HttpResponseStatus status)
      Creates a new FullHttpResponse instance with the specified status and EMPTY content.
      io.netty.handler.codec.http.FullHttpResponse createFull​(io.netty.handler.codec.http.HttpResponseStatus status, io.netty.buffer.ByteBuf content, int contentLength, java.lang.CharSequence contentType)
      Creates a new FullHttpResponse instance with the specified status and content.
      default io.netty.handler.codec.http.FullHttpResponse createFull​(io.netty.handler.codec.http.HttpResponseStatus status, io.netty.buffer.ByteBuf content, java.lang.CharSequence contentType)
      Creates a new FullHttpResponse instance with the specified status and content.
      default io.netty.handler.codec.http.FullHttpResponse createFullText​(io.netty.handler.codec.http.HttpResponseStatus status)
      Creates a new FullHttpResponse instance with the specified status and the content be same with status as text/plain.
      io.netty.handler.codec.http.FullHttpResponse createFullText​(io.netty.handler.codec.http.HttpResponseStatus status, java.nio.charset.Charset charset)
      Creates a new FullHttpResponse instance with the specified status and the content be same with status as text/plain.
    • Method Detail

      • create

        io.netty.handler.codec.http.HttpResponse create​(io.netty.handler.codec.http.HttpResponseStatus status)
        Creates a new HttpResponse instance with the specified status.
        Parameters:
        status - the status
        Returns:
        a HttpResponse
      • createFull

        io.netty.handler.codec.http.FullHttpResponse createFull​(io.netty.handler.codec.http.HttpResponseStatus status)
        Creates a new FullHttpResponse instance with the specified status and EMPTY content.
        Parameters:
        status - the status
        Returns:
        a FullHttpResponse
      • createFull

        default io.netty.handler.codec.http.FullHttpResponse createFull​(io.netty.handler.codec.http.HttpResponseStatus status,
                                                                        io.netty.buffer.ByteBuf content,
                                                                        java.lang.CharSequence contentType)
        Creates a new FullHttpResponse instance with the specified status and content.
        Parameters:
        status - the status
        content - a ByteBuf contains response body
        contentType - the MIME type of the content
        Returns:
        a FullHttpResponse
      • createFull

        io.netty.handler.codec.http.FullHttpResponse createFull​(io.netty.handler.codec.http.HttpResponseStatus status,
                                                                io.netty.buffer.ByteBuf content,
                                                                int contentLength,
                                                                java.lang.CharSequence contentType)
        Creates a new FullHttpResponse instance with the specified status and content.
        Parameters:
        status - the status
        content - a ByteBuf contains response body
        contentLength - the length of the content
        contentType - the MIME type of the content
        Returns:
        a FullHttpResponse
      • createFullText

        default io.netty.handler.codec.http.FullHttpResponse createFullText​(io.netty.handler.codec.http.HttpResponseStatus status)
        Creates a new FullHttpResponse instance with the specified status and the content be same with status as text/plain.
        Parameters:
        status - the status
        Returns:
        a FullHttpResponse
      • createFullText

        io.netty.handler.codec.http.FullHttpResponse createFullText​(io.netty.handler.codec.http.HttpResponseStatus status,
                                                                    java.nio.charset.Charset charset)
        Creates a new FullHttpResponse instance with the specified status and the content be same with status as text/plain.
        Parameters:
        status - the status
        charset - the character-set of the content
        Returns:
        a FullHttpResponse