UrlConnectionHttpTransport

class UrlConnectionHttpTransport(connectTimeoutMillis: Int, readTimeoutMillis: Int) : HttpTransport(source)

HttpTransport on java.net.HttpURLConnection (no third-party HTTP stack). Blocking; ModelDownloader calls it on modelIoDispatcher. Redirects are followed within the same protocol.

Constructors

Link copied to clipboard
constructor(connectTimeoutMillis: Int, readTimeoutMillis: Int)

Functions

Link copied to clipboard
open suspend override fun <T> get(url: String, headers: Map<String, String>, handle: suspend (HttpResponse) -> T): T

Performs a GET of url with headers (for example Range) and passes the response to handle. The response is only valid inside handle; it is closed when handle returns.