forEachPart

suspend fun Multipart.forEachPart(autoRelease: Boolean = true, block: suspend MultipartScope.(Multipart.Part) -> Unit)(source)

A convenience method that wraps Multipart.readNextPart so you don't have to collect it yourself.

Parameters

autoRelease

If true, automatically call Part.release after each part is handled. You can set MultipartScope.autoRelease as well per part inside block, if you need to override this value on a case-by-case basis. (Changing the value for one part will not affect subsequent parts.)