- java.lang.Object
-
- com.github.mizosoft.methanol.MultipartBodyPublisher.Part
-
- Enclosing class:
- MultipartBodyPublisher
public static final class MultipartBodyPublisher.Part extends java.lang.ObjectA 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.BodyPublisherbodyPublisher()Returns theBodyPublisherof this part's content.static MultipartBodyPublisher.Partcreate(java.net.http.HttpHeaders headers, java.net.http.HttpRequest.BodyPublisher bodyPublisher)Returns a newPartwith the given headers and body publisher.java.net.http.HttpHeadersheaders()Returns this part's headers.
-
-
-
Method Detail
-
headers
public java.net.http.HttpHeaders headers()
Returns this part's headers.
-
bodyPublisher
public java.net.http.HttpRequest.BodyPublisher bodyPublisher()
Returns theBodyPublisherof this part's content.
-
create
public static MultipartBodyPublisher.Part create(java.net.http.HttpHeaders headers, java.net.http.HttpRequest.BodyPublisher bodyPublisher)
Returns a newPartwith the given headers and body publisher.- Throws:
java.lang.IllegalArgumentException- if any of the given headers' names is invalid or if aContent-Typeheader is present but the given publisher is aMimeBodyPublisher
-
-