File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,21 @@ public class NSHTTPURLResponse : URLResponse {
228
228
default : return " Server Error "
229
229
}
230
230
}
231
+
232
+ /// A string that represents the contents of the NSHTTPURLResponse Object.
233
+ /// This property is intended to produce readable output.
234
+ override public var description : String {
235
+ var result = " < \( self . dynamicType) \( unsafeAddress ( of: self ) ) > { URL: \( url!. absoluteString) }{ status: \( statusCode) , headers { \n "
236
+ for (key, value) in allHeaderFields {
237
+ if ( ( key. lowercased ( ) == " content-disposition " && suggestedFilename != " Unknown " ) || key. lowercased ( ) == " content-type " ) {
238
+ result += " \" \( key) \" = \" \( value) \" ; \n "
239
+ } else {
240
+ result += " \" \( key) \" = \( value) ; \n "
241
+ }
242
+ }
243
+ result += " } } "
244
+ return result
245
+ }
231
246
}
232
247
233
248
/// Parses the expected content length from the headers.
You can’t perform that action at this time.
0 commit comments