withAccept

fun OkHttpClient.withAccept(mediaTypes: List<MediaType>): OkHttpClient

Returns a new client that sends an Accept header listing mediaTypes on every request that does not set one itself.

Parameters

mediaTypes

The media types to advertise as acceptable response formats.