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 Details

    • canWrite

      boolean canWrite(@Nullable Class<?> type, @Nullable String contentType)
      Whether the given object type is supported by this writer.
      Parameters:
      type - the type of object to check
      contentType - the content type for the write
      Returns:
      true if writable, false otherwise
    • write

      Write a given object to the output message.
      Parameters:
      sender - the http request sender
      body - the object to write
      Returns:
      indicates completion or error