Interface serverRequest.Headers

Enclosing interface:
serverRequest

public static interface serverRequest.Headers
Represents the headers of the HTTP request.
since:
5.2
Author:
Arjen Poutsma
see Also:
  • Method Details

    • accept

      List<MediaType>&nbsp;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

      List<Charset>&nbsp;acceptCharset()
      Get the list of acceptable charsets, as specified by the Accept-Charset header.
    • acceptLanguage

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

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

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

      Get the value of the Host header, if available.

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

    • range

      List<HttpRange>&nbsp;range()
      Get the value of the Range header.

      Returns an empty list when the range is unknown.

    • header

      List<string>&nbsp;header(string&nbsp;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
    • firstHeader

      default&nbsp;@Nullable string&nbsp;firstHeader(string&nbsp;headerName)
      Get the first header value, if any, for the header for the given name.

      Returns null if no header values are found.

      Parameters:
      headerName - the header name
      since:
      5.2.5
    • asHttpHeaders

      HttpHeaders&nbsp;asHttpHeaders()
      Get the headers as an instance of HttpHeaders.