Skip to content

Latest commit

 

History

History
30 lines (26 loc) · 579 Bytes

README.md

File metadata and controls

30 lines (26 loc) · 579 Bytes

AppHttp

Android Library, http functions.

config

//allow dump request and response info
HttpConfig.allowDumpByDebugFlag(this)
HttpConfig.debugPrinter = { Log.d("http", it) }

example GET

//run in background thread
val resp = httpGet("https://entao.dev/") {
    "user" arg "tom"
}
val text = resp.valueText
Log.d("http", text ?: "null")

example upload file

 val resp = httpMultipart(this, "https://entao.dev/") {
    "user" arg "tom"
    file("fileA", File("..."))
}
val text = resp.valueText
Log.d("http", text ?: "null")