Package discord4j.rest.http
Class MultipartWriterStrategy
java.lang.Object
discord4j.rest.http.MultipartWriterStrategy
- All Implemented Interfaces:
WriterStrategy<MultipartRequest<?>>
Write to a request from a
Consumer<HttpClientRequest.Form>
using reactor-netty's HttpClient.RequestSender.sendForm(java.util.function.BiConsumer)
.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Whether the given object type is supported by this writer.write
(HttpClient.RequestSender send, MultipartRequest<?> body) Write a given object to the output message.
-
Constructor Details
-
MultipartWriterStrategy
-
-
Method Details
-
canWrite
Description copied from interface:WriterStrategy
Whether the given object type is supported by this writer.- Specified by:
canWrite
in interfaceWriterStrategy<MultipartRequest<?>>
- Parameters:
type
- the type of object to checkcontentType
- the content type for the write- Returns:
true
if writable,false
otherwise
-
write
public Mono<HttpClient.ResponseReceiver<?>> write(HttpClient.RequestSender send, @Nullable MultipartRequest<?> body) Description copied from interface:WriterStrategy
Write a given object to the output message.- Specified by:
write
in interfaceWriterStrategy<MultipartRequest<?>>
- Parameters:
send
- the http request senderbody
- the object to write- Returns:
- indicates completion or error
-