All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.devslash.outputs.DebugOutput.kt Maven / Gradle / Ivy

There is a newer version: 0.26.2
Show newest version
package net.devslash.outputs

import net.devslash.HttpResponse
import net.devslash.OutputFormat
import net.devslash.RequestData
import net.devslash.mustGet

class DebugOutput : OutputFormat {
  override fun accept(resp: HttpResponse, data: RequestData<*>): ByteArray {
    return """
              ----------------
              url: ${resp.uri}
              status: ${resp.statusCode}
              headers: [${resp.headers}]
              data: ${data.mustGet()}
              duration: ${resp.requestDuration.toMillis()}ms
              body ->
              ${String(resp.body)}
              ----------------
           """.trimIndent().toByteArray()
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy