Package dev.gmitch215.bytebox.net.http
Class HttpRequest.BodyPublishers
java.lang.Object
dev.gmitch215.bytebox.net.http.HttpRequest.BodyPublishers
- Enclosing class:
HttpRequest
The request bodies there are.
-
Method Summary
Modifier and TypeMethodDescriptionstatic HttpRequest.BodyPublishernoBody()Returns a publisher that sends nothing.static HttpRequest.BodyPublisherofByteArray(byte[] body) A body of bytes.static HttpRequest.BodyPublisherofByteArray(byte[] body, int offset, int length) Part of an array of bytes.static HttpRequest.BodyPublisherA body of text.static HttpRequest.BodyPublisherA body of text in a given encoding.
-
Method Details
-
ofString
A body of text.- Parameters:
body- the text, encoded as UTF-8- Returns:
- the publisher
-
ofString
A body of text in a given encoding.- Parameters:
body- the textcharset- how to encode it- Returns:
- the publisher
-
ofByteArray
A body of bytes.- Parameters:
body- the bytes- Returns:
- the publisher
-
ofByteArray
Part of an array of bytes.- Parameters:
body- the bytesoffset- where to startlength- how many- Returns:
- the publisher
-
noBody
Returns a publisher that sends nothing.- Returns:
- a publisher that sends nothing
-