HttpBase.kt

  1. package com.hexagonkt.http.model

  2. interface HttpBase {
  3.     val body: Any
  4.     val headers: Headers
  5.     val contentType: ContentType?

  6.     fun bodyString(): String =
  7.         when (body) {
  8.             is String -> body as String
  9.             is ByteArray -> String(body as ByteArray)
  10.             else -> body.toString()
  11.         }
  12. }