net.devslash.outputs.DebugOutput.kt Maven / Gradle / Ivy
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