diff --git a/src/main/java/ext/Http.kt b/src/main/java/ext/Http.kt index 44b7f60e..b01c7c36 100644 --- a/src/main/java/ext/Http.kt +++ b/src/main/java/ext/Http.kt @@ -17,7 +17,7 @@ fun HttpRequest.Builder.post(body: Any? = null) = this.POST(when (body) { is ByteArray -> HttpRequest.BodyPublishers.ofByteArray(body) is String -> HttpRequest.BodyPublishers.ofString(body) is HttpRequest.BodyPublisher -> body - else -> throw Exception("Unsupported body type") + else -> throw IllegalArgumentException("Unsupported body type") }).send()