org.springframework.http

Interface RequestEntity.HeadersBuilder<B extends RequestEntity.HeadersBuilder<B>>

  • Type Parameters:
    B - the builder subclass
    All Known Subinterfaces:
    RequestEntity.BodyBuilder
    Enclosing class:
    RequestEntity<T>


    public static interface RequestEntity.HeadersBuilder<B extends RequestEntity.HeadersBuilder<B>>
    Defines a builder that adds headers to the request entity.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method and Description
      B accept(MediaType... acceptableMediaTypes)
      Set the list of acceptable media types, as specified by the Accept header.
      B acceptCharset(java.nio.charset.Charset... acceptableCharsets)
      Set the list of acceptable charsets, as specified by the Accept-Charset header.
      RequestEntity<java.lang.Void> build()
      Builds the request entity with no body.
      B header(java.lang.String headerName, java.lang.String... headerValues)
      Add the given, single header value under the given name.
      B ifModifiedSince(long ifModifiedSince)
      Set the value of the If-Modified-Since header.
      B ifNoneMatch(java.lang.String... ifNoneMatches)
      Set the values of the If-None-Match header.
    • Method Detail

      • header

        B header(java.lang.String headerName,
                 java.lang.String... headerValues)
        Add the given, single header value under the given name.
        Parameters:
        headerName - the header name
        headerValues - the header value(s)
        Returns:
        this builder
        See Also:
        HttpHeaders.add(String, String)
      • accept

        B accept(MediaType... acceptableMediaTypes)
        Set the list of acceptable media types, as specified by the Accept header.
        Parameters:
        acceptableMediaTypes - the acceptable media types
      • acceptCharset

        B acceptCharset(java.nio.charset.Charset... acceptableCharsets)
        Set the list of acceptable charsets, as specified by the Accept-Charset header.
        Parameters:
        acceptableCharsets - the acceptable charsets
      • ifModifiedSince

        B ifModifiedSince(long ifModifiedSince)
        Set the value of the If-Modified-Since header.

        The date should be specified as the number of milliseconds since January 1, 1970 GMT.

        Parameters:
        ifModifiedSince - the new value of the header
      • ifNoneMatch

        B ifNoneMatch(java.lang.String... ifNoneMatches)
        Set the values of the If-None-Match header.
        Parameters:
        ifNoneMatches - the new value of the header