Class HttpRequest.BodyPublisher

java.lang.Object
dev.gmitch215.bytebox.net.http.HttpRequest.BodyPublisher
Enclosing class:
HttpRequest

public static final class HttpRequest.BodyPublisher extends Object
A request body.

Only the ones HttpRequest.BodyPublishers makes: the platform sends a request in one call rather than as a stream of items, so there is nothing here for a publisher of your own to be driven by. Writing one fails to compile, which is where it should fail.

  • Method Details

    • contentLength

      public long contentLength()
      Returns the length, which is always known because the body is always in hand.
      Returns:
      the length, which is always known because the body is always in hand