jsonRequest

fun OkHttpClient.jsonRequest(url: String, method: HttpMethod, json: Any, headers: Headers = Headers.headersOf(), userAgent: String? = null): Call

Creates a JSON request 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.

json

The JSON data to be sent with the request. It could be a json string.

headers

The headers for the request.

userAgent

The User-Agent header for the request.