anli
05/15/2018, 10:23 AMval response = client.call("some/url") {
contentType(ContentType.Application.Json)
method = <http://HttpMethod.Post|HttpMethod.Post>
headers = HeadersBuilder ()
body = data
}
But compiler climes "Val can not be reassigned" against headers
. So. how are you settings custom client headers?orangy
e5l
05/15/2018, 10:37 AManli
05/15/2018, 10:43 AMDeactivated User
05/15/2018, 10:45 AMheader
function:
val response = client.call(“some/url”) {
contentType(ContentType.Application.Json)
method = <http://HttpMethod.Post|HttpMethod.Post>
headers.clear() // clear headers
header(“header”, “value”) // set one header
headers {
header(“header”, “value”)
}
body = data
}
e5l
05/15/2018, 10:46 AMheader
method, or add it by hand:
client.call {
headers.append("Hello", "World")
headers.append("Hello2", "World2")
}
Deactivated User
05/15/2018, 10:46 AMheaders.clear
, or headers.append
. But if you don’t care about other headers, you can just call header
Going to update the documentation with thisanli
05/15/2018, 10:49 AMDeactivated User
05/15/2018, 11:01 AManli
05/15/2018, 11:25 AM