Skip to content

//okhttp/okhttp3/Response/Builder

Builder

[common]\ expect open class Builder

[jvm, nonJvm]\ actual open class Builder

Constructors

Builder [common]
expect fun Builder()
[jvm, nonJvm]
actual fun Builder()

Functions

Name Summary
addHeader [common, nonJvm]
[common]
expect open fun addHeader(name: String, value: String): Response.Builder
[nonJvm]
actual open fun addHeader(name: String, value: String): Response.Builder
Adds a header with name to value. Prefer this method for multiply-valued headers like "Set-Cookie".
[jvm]
actual open fun addHeader(name: String, value: String): Response.Builder
body [common, jvm, nonJvm]
[common]
expect open fun body(body: ResponseBody): Response.Builder
[jvm, nonJvm]
actual open fun body(body: ResponseBody): Response.Builder
build [common, jvm, nonJvm]
[common]
expect open fun build(): Response
[jvm, nonJvm]
actual open fun build(): Response
cacheResponse [common, jvm, nonJvm]
[common]
expect open fun cacheResponse(cacheResponse: Response?): Response.Builder
[jvm, nonJvm]
actual open fun cacheResponse(cacheResponse: Response?): Response.Builder
code [common, jvm, nonJvm]
[common]
expect open fun code(code: Int): Response.Builder
[jvm, nonJvm]
actual open fun code(code: Int): Response.Builder
handshake [jvm]
open fun handshake(handshake: Handshake?): Response.Builder
header [common, nonJvm]
[common]
expect open fun header(name: String, value: String): Response.Builder
[nonJvm]
actual open fun header(name: String, value: String): Response.Builder
Sets the header named name to value. If this request already has any headers with that name, they are all replaced.
[jvm]
actual open fun header(name: String, value: String): Response.Builder
headers [common, nonJvm]
[common]
expect open fun headers(headers: Headers): Response.Builder
[nonJvm]
actual open fun headers(headers: Headers): Response.Builder
Removes all headers on this builder and adds headers.
[jvm]
actual open fun headers(headers: Headers): Response.Builder
message [common, jvm, nonJvm]
[common]
expect open fun message(message: String): Response.Builder
[jvm, nonJvm]
actual open fun message(message: String): Response.Builder
networkResponse [common, jvm, nonJvm]
[common]
expect open fun networkResponse(networkResponse: Response?): Response.Builder
[jvm, nonJvm]
actual open fun networkResponse(networkResponse: Response?): Response.Builder
priorResponse [common, jvm, nonJvm]
[common]
expect open fun priorResponse(priorResponse: Response?): Response.Builder
[jvm, nonJvm]
actual open fun priorResponse(priorResponse: Response?): Response.Builder
protocol [common, jvm, nonJvm]
[common]
expect open fun protocol(protocol: Protocol): Response.Builder
[jvm, nonJvm]
actual open fun protocol(protocol: Protocol): Response.Builder
receivedResponseAtMillis [jvm]
open fun receivedResponseAtMillis(receivedResponseAtMillis: Long): Response.Builder
removeHeader [common, nonJvm]
[common]
expect open fun removeHeader(name: String): Response.Builder
[nonJvm]
actual open fun removeHeader(name: String): Response.Builder
Removes all headers named name on this builder.
[jvm]
actual open fun removeHeader(name: String): Response.Builder
request [common, jvm, nonJvm]
[common]
expect open fun request(request: Request): Response.Builder
[jvm, nonJvm]
actual open fun request(request: Request): Response.Builder
sentRequestAtMillis [jvm]
open fun sentRequestAtMillis(sentRequestAtMillis: Long): Response.Builder
trailers [common, jvm, nonJvm]
[common]
expect open fun trailers(trailersFn: () -> Headers): Response.Builder
[jvm, nonJvm]
actual open fun trailers(trailersFn: () -> Headers): Response.Builder