Skip to content

Instantly share code, notes, and snippets.

@jwalgemoed
Last active December 28, 2017 10:12
Show Gist options
  • Save jwalgemoed/b60daceaac3da7849e52047d98b4b58c to your computer and use it in GitHub Desktop.
Save jwalgemoed/b60daceaac3da7849e52047d98b4b58c to your computer and use it in GitHub Desktop.
fun Contract.Builder.request(builder: Request.Builder.() -> Unit) {
this.request = Request.Builder().apply(builder)
}
fun Contract.Builder.response(builder: Response.Builder.() -> Unit) {
this.response = Response.Builder().apply(builder)
}
fun Request.Builder.headers(headers: HttpHeaders.() -> Unit) {
this.headers = HttpHeaders().apply(headers)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment