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

org.http4k.strikt.httpMessage.kt Maven / Gradle / Ivy

There is a newer version: 5.31.0.0
Show newest version
package org.http4k.strikt

import org.http4k.core.HttpMessage
import org.http4k.format.Json
import org.http4k.lens.Header.CONTENT_TYPE
import org.http4k.lens.HeaderLens
import strikt.api.Assertion

fun  Assertion.Builder.header(lens: HeaderLens) = get { lens(this) }
fun  Assertion.Builder.header(name: String) = get { header(name) }
fun  Assertion.Builder.headerValues(name: String) = get { headerValues(name) }

val  Assertion.Builder.contentType get() = get { CONTENT_TYPE(this) }
val  Assertion.Builder.body get() = get(HttpMessage::body)
val  Assertion.Builder.bodyString get() = get { bodyString() }

fun  Assertion.Builder.jsonBody(json: Json) = get { json.parse(bodyString()) }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy