mirror of
https://github.com/tursom/TursomServer.git
synced 2025-01-16 15:21:19 +08:00
update
This commit is contained in:
parent
9c0b467445
commit
eecc290d7a
@ -129,26 +129,30 @@ object AsyncHttpRequest {
|
||||
headers: Map<String, String>? = null,
|
||||
client: OkHttpClient = defaultClient
|
||||
) = post(
|
||||
url,
|
||||
RequestBody.create(MediaType.parse("application/octet-stream"), body),
|
||||
headers,
|
||||
client
|
||||
)
|
||||
|
||||
url,
|
||||
RequestBody.create(MediaType.parse("application/octet-stream"), body),
|
||||
headers,
|
||||
client
|
||||
)
|
||||
|
||||
suspend fun getStr(
|
||||
url: String,
|
||||
param: Map<String, String>? = null,
|
||||
headers: Map<String, String>? = null
|
||||
): String =
|
||||
getStr(url, param, headers, defaultClient)
|
||||
|
||||
): String {
|
||||
return getStr(url, param, headers, defaultClient)
|
||||
}
|
||||
|
||||
@Suppress("BlockingMethodInNonBlockingContext")
|
||||
suspend fun getStr(
|
||||
url: String,
|
||||
param: Map<String, String>? = null,
|
||||
headers: Map<String, String>? = null,
|
||||
client: OkHttpClient
|
||||
): String = get(url, param, headers, client).body()!!.string()
|
||||
): String {
|
||||
val response = get(url, param, headers, client)
|
||||
return response.body()!!.string()
|
||||
}
|
||||
|
||||
@Suppress("BlockingMethodInNonBlockingContext")
|
||||
private suspend fun postStr(
|
||||
|
Loading…
Reference in New Issue
Block a user