Package discord4j.rest.http
Interface WriterStrategy<R>
- Type Parameters:
R- the type of object in the body
- All Known Implementing Classes:
EmptyWriterStrategy,FormUrlEncodedWriterStrategy,JacksonWriterStrategy,MultipartWriterStrategy
public interface WriterStrategy<R>
Strategy for encoding an object of type
<Req> and writing the encoded stream of bytes to an HttpClientRequest.-
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the given object type is supported by this writer.write(HttpClient.RequestSender sender, R body) Write a given object to the output message.
-
Method Details
-
canWrite
Whether the given object type is supported by this writer.- Parameters:
type- the type of object to checkcontentType- the content type for the write- Returns:
trueif writable,falseotherwise
-
write
Write a given object to the output message.- Parameters:
sender- the http request senderbody- the object to write- Returns:
- indicates completion or error
-