接口 ResponseEntity.HeadersBuilder<B extends ResponseEntity.HeadersBuilder<B>>

    • 方法概要

      所有方法 实例方法 抽象方法 
      修饰符和类型方法说明
      Ballow​(HttpMethod... allowedMethods)
      Set the set of allowed HTTP methods, as specified by the Allow header.
      <T> ResponseEntity<T>build()
      Build the response entity with no body.
      BcacheControl​(CacheControl cacheControl)
      Set the caching directives for the resource, as specified by the HTTP 1.1 Cache-Control header.
      BeTag​(String etag)
      Set the entity tag of the body, as specified by the ETag header.
      Bheader​(String headerName, String... headerValues)
      Add the given, single header value under the given name.
      Bheaders​(HttpHeaders headers)
      Copy the given headers into the entity's headers map.
      BlastModified​(long lastModified)
      Set the time the resource was last changed, as specified by the Last-Modified header.
      Blocation​(URI location)
      Set the location of a resource, as specified by the Location header.
      BvaryBy​(String... requestHeaders)
      Configure one or more request header names (e.g.
    • 方法详细资料

      • header

        B header​(String headerName,
                 String... headerValues)
        Add the given, single header value under the given name.
        参数:
        headerName - the header name
        headerValues - the header value(s)
        返回:
        this builder
        另请参阅:
        HttpHeaders.add(String, String)
      • lastModified

        B lastModified​(long lastModified)
        Set the time the resource was last changed, as specified by the Last-Modified header.

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

        参数:
        lastModified - the last modified date
        返回:
        this builder
        另请参阅:
        HttpHeaders.setLastModified(long)
      • cacheControl

        B cacheControl​(CacheControl cacheControl)
        Set the caching directives for the resource, as specified by the HTTP 1.1 Cache-Control header.

        A CacheControl instance can be built like CacheControl.maxAge(3600).cachePublic().noTransform().

        参数:
        cacheControl - a builder for cache-related HTTP response headers
        返回:
        this builder
        从以下版本开始:
        4.2
        另请参阅:
        RFC-7234 Section 5.2
      • varyBy

        B varyBy​(String... requestHeaders)
        Configure one or more request header names (e.g. "Accept-Language") to add to the "Vary" response header to inform clients that the response is subject to content negotiation and variances based on the value of the given request headers. The configured request header names are added only if not already present in the response "Vary" header.
        参数:
        requestHeaders - request header names
        从以下版本开始:
        4.3