Update src/main/java/ext/Http.kt

Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
This commit is contained in:
Azalea
2025-03-21 16:52:54 -04:00
committed by GitHub
co-authored by sourcery-ai[bot]
parent 8efb3d7554
commit 166fd9e6b7
+1 -1
View File
@@ -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()