mirror of
https://github.com/MewoLab/AquaDX.git
synced 2025-12-14 11:56:15 +08:00
[O] Longer timeout
This commit is contained in:
@@ -11,7 +11,7 @@ val client = HttpClient.newBuilder().build()
|
||||
|
||||
fun HttpRequest.Builder.send() = client.send(this.build(), HttpResponse.BodyHandlers.ofByteArray())
|
||||
fun HttpRequest.Builder.header(pair: Pair<Any, Any>) = this.header(pair.first.toString(), pair.second.toString())
|
||||
fun String.request() = HttpRequest.newBuilder(URI.create(this)).timeout(Duration.ofSeconds(10))
|
||||
fun String.request() = HttpRequest.newBuilder(URI.create(this)).timeout(Duration.ofMinutes(5))
|
||||
|
||||
fun HttpRequest.Builder.post(body: Any? = null) = this.POST(when (body) {
|
||||
is ByteArray -> HttpRequest.BodyPublishers.ofByteArray(body)
|
||||
|
||||
Reference in New Issue
Block a user