public fun expectHttpBody()

in ktor-http/ktor-http-cio/common/src/io/ktor/http/cio/HttpBody.kt [39:54]


public fun expectHttpBody(
    method: HttpMethod,
    contentLength: Long,
    transferEncoding: CharSequence?,
    connectionOptions: ConnectionOptions?,
    contentType: CharSequence?
): Boolean {
    if (transferEncoding != null) return true
    if (contentLength != -1L) return contentLength > 0L
    if (contentType != null) return true

    if (method == HttpMethod.Get || method == HttpMethod.Head || method == HttpMethod.Options) return false
    if (connectionOptions?.close == true) return true

    return false
}