mockwebserver / okhttp3.mockwebserver / MockResponse / addHeader

addHeader

fun addHeader(header: String): MockResponse

Adds header as an HTTP header. For well-formed HTTP header should contain a name followed by a colon and a value.

fun addHeader(name: String, value: Any): MockResponse

Adds a new header with the name and value. This may be used to add multiple headers with the same name.