withMediaType

fun <Error class: unknown class>.withMediaType(mediaType: MediaType): MimeBodyPublisher

Associated the given media type with this BodyPublisher through a MimeBodyPublisher. This allows the Client to automatically add a corresponding Content-Type header.