User agent
This plugin (previously known as feature) adds a User-Agent header to requests.
Install
import io.ktor.client.features.*
val client = HttpClient() {
// Full configuration.
install(UserAgent) {
agent = "ktor"
}
// Shortcut for the browser-like user agent.
BrowserUserAgent()
// Shortcut for the curl-like user agent.
CurlUserAgent()
}
Last modified: 14 July 2021