From f6b5dde79594b2abb07336d8c1c14b7f317e7a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elvis=20Nu=C3=B1ez?= Date: Thu, 8 Oct 2015 14:58:09 +0200 Subject: [PATCH] Print response status code --- Source/Networking.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/Networking.swift b/Source/Networking.swift index 1d48746..0260bea 100644 --- a/Source/Networking.swift +++ b/Source/Networking.swift @@ -170,10 +170,8 @@ public class Networking { print("Error \(error.code): \(error.description)") print(" ") - if let response = response { - print("Path: \(response.URL!.absoluteString)") - print(" ") - print("Response: \(response)") + if let request = request { + print("Request: \(request)") print(" ") } @@ -187,8 +185,12 @@ public class Networking { print(" ") } - if let request = request { - print("Request: \(request)") + if let response = response as? NSHTTPURLResponse { + print("Response status code: \(response.statusCode)") + print(" ") + print("Path: \(response.URL!.absoluteString)") + print(" ") + print("Response: \(response)") print(" ") }