Module bus.http

Interface CacheRequest


public interface CacheRequest
An interface for writing a response to the cache.

Implementations of this interface provide a Sink to which the response body can be written.

Since:
Java 17+
Author:
Kimi Liu
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Aborts this cache request.
    org.miaixz.bus.core.io.sink.Sink
    Returns a sink that can be used to write the response body to the cache.
  • Method Details

    • body

      org.miaixz.bus.core.io.sink.Sink body() throws IOException
      Returns a sink that can be used to write the response body to the cache.
      Returns:
      The sink for the response body.
      Throws:
      IOException - if an I/O error occurs.
    • abort

      void abort()
      Aborts this cache request.

      This should be called when the response body cannot be written, for example, due to a network error.