request

abstract suspend fun request(endpoint: String, path: String, filePaths: List<String>, connectionTimeout: Long, socketTimeout: Long, callback: (Int) -> Unit?, boundary: String = BOUNDARY): ByteArray

Send a HTTP request.

Return

body of the response

Parameters

endpoint

endpoint of Web API, eg. "http://192.198.1.1:80/"

path

request target of HTTP

filePaths

Content of each part

connectionTimeout

timeout for connection (millisecond). If null, default value is used.

socketTimeout

timeout for socket (millisecond). If null, default value is used.

callback

function to pass the percentage of sent firmware

boundary

boundary parameter of multipart/form-data. If this is not specified, default value is used.