File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ public protocol URLRequestable: URLComponeble {
1010 var method : HTTPMethod { get }
1111 var parameters : [ String : Any ] ? { get set }
1212 var encoding : URLEncoding { get }
13+ var allHTTPHeaderFields : [ String : String ] ? { get set }
1314
1415 mutating func addParameter( key: String , value: String )
1516 func asURLRequest( ) throws -> URLRequest
@@ -32,6 +33,13 @@ public extension URLRequestable {
3233 }
3334 var urlRequest = URLRequest ( url: url)
3435 urlRequest. httpMethod = method. rawValue
36+ urlRequest. allHTTPHeaderFields = self . allHTTPHeaderFields
3537 return urlRequest
3638 }
3739}
40+
41+ // Defaul Implementation
42+
43+ public extension URLRequestable {
44+ var allHTTPHeaderFields : [ String : String ] ? { nil }
45+ }
You can’t perform that action at this time.
0 commit comments