Interface AggregatedHttpRequest


  • public interface AggregatedHttpRequest
    A complete HTTP request whose content is readily available as a single HttpData.
    • Method Detail

      • of

        static AggregatedHttpRequest of​(HttpMethod method,
                                        String path)
        Creates a new HTTP request with empty content.
        Parameters:
        method - the HTTP method of the request
        path - the path of the request
      • of

        static AggregatedHttpRequest of​(HttpMethod method,
                                        String path,
                                        MediaType mediaType,
                                        String content)
        Creates a new HTTP request.
        Parameters:
        method - the HTTP method of the request
        path - the path of the request
        mediaType - the MediaType of the request content
        content - the content of the request
      • of

        static AggregatedHttpRequest of​(HttpMethod method,
                                        String path,
                                        MediaType mediaType,
                                        byte[] content)
        Creates a new HTTP request. The content will be wrapped using HttpData.wrap(byte[]), so any changes made to content will be reflected in the request.
        Parameters:
        method - the HTTP method of the request
        path - the path of the request
        mediaType - the MediaType of the request content
        content - the content of the request
      • path

        String path()
        Returns the PATH of this request.
      • scheme

        @Nullable
        String scheme()
        Returns the SCHEME of this request.
        Returns:
        the scheme, or null if there's no such header
      • authority

        @Nullable
        String authority()
        Returns the AUTHORITY of this request, in the form of "hostname:port".
        Returns:
        the authority, or null if there's no such header
      • toHttpRequest

        default HttpRequest toHttpRequest()
        Converts this request into a new complete HttpRequest.
        Returns:
        the new HttpRequest converted from this request.
      • trailers

        HttpHeaders trailers()
        Returns the HTTP trailers.
      • content

        HttpData content()
        Returns the content of this message.
      • content

        default String content​(Charset charset)
        Returns the content of this message as a string encoded in the specified Charset.
      • contentUtf8

        default String contentUtf8()
        Returns the content of this message as a UTF-8 string.
      • contentAscii

        default String contentAscii()
        Returns the content of this message as an ASCII string.
      • contentType

        @Nullable
        default MediaType contentType()
        Returns the value of the 'content-type' header.
        Returns:
        the valid header value if present. null otherwise.