delete

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

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

DELETE requests typically don't have a body, but some APIs support it. If a body is provided, the Content-Type is set to application/json.

Parameters

body

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


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

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

DELETE requests typically don't have a body, but some APIs support it. 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.