User Agent

note

User Agent - 图1

This help topic is in development and will be updated in the future.

This feature adds a User-Agent header to requests.

Install

  1. val client = HttpClient() {
  2. // Full configuration.
  3. install(UserAgent) {
  4. agent = "ktor"
  5. }
  6. // Shortcut for the browser-like user agent.
  7. BrowserUserAgent()
  8. // Shortcut for the curl-like user agent.
  9. CurlUserAgent()
  10. }