genericBodyRequest

fun OkHttpClient.genericBodyRequest(url: String, method: HttpMethod, body: String, mediaType: MediaType?, headers: Headers = Headers.headersOf(), userAgent: String? = null): Call

Creates a request with a generic body using the specified HTTP method.

Return

A Call object representing the request.

Parameters

url

The URL for the request.

method

The HTTP method for the request.

body

The body data to be sent with the request.

mediaType

The MediaType of the request body.

headers

The headers for the request.

userAgent

The User-Agent header for the request.