Jeff Lockhart
09/15/2021, 6:50 PMappend()
or appendAll()
functions to add headers to a request.
For example, the example in the documentation:
val response: HttpResponse = client.get("<https://ktor.io/>") {
headers {
append(HttpHeaders.Accept, "text/html") // warning
append(HttpHeaders.Authorization, "token") // warning
append(HttpHeaders.UserAgent, "ktor client") // warning
}
}
Is there a new pattern that should be used for this? Why is StringValuesBuilder
marked @InternalAPI
now? Using ktor 1.6.3.Rustam Siniukov
09/15/2021, 7:00 PM@OptIn
annotation to remove the warning. Will be fixed in 2.0.0
See more details here https://youtrack.jetbrains.com/issue/KTOR-3001Jeff Lockhart
09/15/2021, 7:12 PM