org.springframework.web.reactive.function.server

Interface ServerRequest.Headers

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      java.util.List<MediaType> accept()
      Get the list of acceptable media types, as specified by the Accept header.
      java.util.List<java.nio.charset.Charset> acceptCharset()
      Get the list of acceptable charsets, as specified by the Accept-Charset header.
      java.util.List<java.util.Locale.LanguageRange> acceptLanguage()
      Get the list of acceptable languages, as specified by the Accept-Language header.
      HttpHeaders asHttpHeaders()
      Get the headers as an instance of HttpHeaders.
      java.util.OptionalLong contentLength()
      Get the length of the body in bytes, as specified by the Content-Length header.
      java.util.Optional<MediaType> contentType()
      Get the media type of the body, as specified by the Content-Type header.
      java.util.List<java.lang.String> header(java.lang.String headerName)
      Get the header value(s), if any, for the header of the given name.
      java.net.InetSocketAddress host()
      Get the value of the required Host header.
      java.util.List<HttpRange> range()
      Get the value of the Range header.
    • Method Detail

      • accept

        java.util.List<MediaType> accept()
        Get the list of acceptable media types, as specified by the Accept header.

        Returns an empty list if the acceptable media types are unspecified.

      • acceptCharset

        java.util.List<java.nio.charset.Charset> acceptCharset()
        Get the list of acceptable charsets, as specified by the Accept-Charset header.
      • acceptLanguage

        java.util.List<java.util.Locale.LanguageRange> acceptLanguage()
        Get the list of acceptable languages, as specified by the Accept-Language header.
      • contentLength

        java.util.OptionalLong contentLength()
        Get the length of the body in bytes, as specified by the Content-Length header.
      • contentType

        java.util.Optional<MediaType> contentType()
        Get the media type of the body, as specified by the Content-Type header.
      • host

        @Nullable
        java.net.InetSocketAddress host()
        Get the value of the required Host header.

        If the header value does not contain a port, the port in the returned address will be 0.

      • range

        java.util.List<HttpRange> range()
        Get the value of the Range header.

        Returns an empty list when the range is unknown.

      • header

        java.util.List<java.lang.String> header(java.lang.String headerName)
        Get the header value(s), if any, for the header of the given name.

        Returns an empty list if no header values are found.

        Parameters:
        headerName - the header name