-
Notifications
You must be signed in to change notification settings - Fork 126
Closed
Milestone
Description
Hi there, was skimming the APIs a little bit and found the configuration type names a bit weird.
Specifically, the fields of Configuration
using short names looks fun, but is also quite confusing imho, e.g. Timeout:
var config = HTTPClient.Configuration()
config.timeout = HTTPClient.Timeout() // this is not "a" Timeout, but configuration
// a) rename? TimeoutConfiguration
let t = HTTPClient.TimeoutConfiguration()
// b) move?
let t = HTTPClient.Configuration.Timeout()
The types are nested in HTTPClient
which makes it read like "this is the http client timeout", which it is not, it is just the settings what time timeouts shall be.
Looking at types:
public struct Configuration {
public var tlsConfiguration: TLSConfiguration?
public var followRedirects: Bool
public var timeout: Timeout
public var proxy: Proxy?
}
Timeout should likely be called TimeoutConfiguration
; WDYT?
Proxy is likely fine, since that indeed is the value of the proxy to be used... though tbh future proof would be to make it a Configuration as well IMHO (in case it'd get per destination proxying or not etc)
Metadata
Metadata
Assignees
Labels
No labels