Module methanol

Class MultipartBodyPublisher.Part

  • Enclosing class:
    MultipartBodyPublisher

    public static final class MultipartBodyPublisher.Part
    extends java.lang.Object
    A part in a multipart request body.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.net.http.HttpRequest.BodyPublisher bodyPublisher()
      Returns the BodyPublisher of this part's content.
      static MultipartBodyPublisher.Part create​(java.net.http.HttpHeaders headers, java.net.http.HttpRequest.BodyPublisher bodyPublisher)
      Returns a new Part with the given headers and body publisher.
      java.net.http.HttpHeaders headers()
      Returns this part's headers.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • headers

        public java.net.http.HttpHeaders headers()
        Returns this part's headers.
      • bodyPublisher

        public java.net.http.HttpRequest.BodyPublisher bodyPublisher()
        Returns the BodyPublisher of this part's content.
      • create

        public static MultipartBodyPublisher.Part create​(java.net.http.HttpHeaders headers,
                                                         java.net.http.HttpRequest.BodyPublisher bodyPublisher)
        Returns a new Part with the given headers and body publisher.
        Throws:
        java.lang.IllegalArgumentException - if any of the given headers' names is invalid or if a Content-Type header is present but the given publisher is a MimeBodyPublisher