Closed tylermilner closed 4 years ago
This might make it a little nicer when you need to use customer header keys/values.
extension HTTP.HeaderValue: ExpressibleByStringLiteral { public init(stringLiteral value: StringLiteralType) { self.init(rawValue: value) } }
This would allow you to quickly mix pre-defined and custom header values:
struct APIHeaders { static let defaultHeaders: [HTTP.HeaderKey: HTTP.HeaderValue] = [.authorization: "Basic abc123"] }
Instead of needing to manually init the HTTP.HeaderValue every time:
HTTP.HeaderValue
struct APIHeaders { static let defaultHeaders: [HTTP.HeaderKey: HTTP.HeaderValue] = [.authorization: HTTP.HeaderValue(rawValue: "abc123")] }
This might make it a little nicer when you need to use customer header keys/values.
This would allow you to quickly mix pre-defined and custom header values:
Instead of needing to manually init the
HTTP.HeaderValue
every time: