put

abstract fun put(body: JsonObject = buildJsonObject {})

Sets the HTTP method to PUT and optionally sets a JSON body.

PUT requests are typically used to update resources. If a body is provided, the Content-Type is set to application/json.

Parameters

body

Optional JSON body for the PUT request. Defaults to empty.


abstract fun put(contentType: String = CONTENT_TYPE, body: String)

Sets the HTTP method to PUT with custom content type and body.

PUT requests are typically used to update resources. This method allows specifying a custom Content-Type header along with the body content as a string.

Parameters

contentType

The Content-Type header value (e.g., "text/plain", "application/xml").

body

The request body as a string.